-
-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Network | Connection test timeout #2831
Comments
@1985kasper
Our default timeout is 5s which should be more than sufficient. But lately we received multiple reports where it was not, with connection times 6-15 seconds and such. Totally unacceptable an no idea so far where this comes from, perhaps some bad package update, not sure. For this we implemented the possibility to manually adjust the timeout, sadly with v6.23. So you need to manually raise it:
Then rerun: Since the update includes a kernel upgrade to v4.19, it would be interesting if that solved the issue, who knows. So retest connection time:
If it is still > 5 seconds, adjust it in: |
jep tried with ftp.mirror.transip.net/raspbian/raspbian (since i am in NL i thought i might as well take the closest one). Can't copy paste the result cause i am doing this physicly with screen/keyboard but it's 0m5.296s so indeed just over 5s |
@1985kasper |
Yeah it fixed it! It turned me crazy! thought my network was failing me... btw offtopic: I strongly believe in security. The current root enabled wide open default setup is a bit dangerous for novice users enthusiastically opening up their port 22 to the internet for example. Do you mind if i open a feauture request to suggest some hardening? Maybe this can be an optional choice at first boot. But i do believe root should be disables at all times and replaced by a sudo user etc. just basic security 101 |
The same failure is now happening for github: https://raw.githubusercontent.com/MichaIng/DietPi/master/dietpi.txt Adjusted timeout time to 15 seconds in the config network misc but not sure if it applies to github as well as the mirror. |
@1985kasper Please apply the step that was failing manually (includes timeout raise to 20s, just to be failsafe):
Then re-run the update, just to be failsafe: |
This was a first boot of a fresh image. But the setup continued after showing the error. |
I think I have to collect all reports about >5s timeouts and see if we find any similarities. If I remember right it is actually the DNS resolving step, not the connection to the bare IP itself. But trying out different DNS nameservers didn't change it. So anything related to the DNS resolving mechanism system wise must be going wrong. But I could never replicate it, have connections times < 0.5s here on all systems and machines... 🤔 About your sudo suggestion:
Perhaps we should collect such security relevant infos and make them available for users, either within the DietPi system on first run setup or at our online docs. |
Made a start with security recommendations: https://github.com/MichaIng/DietPi/wiki/Security-recommendation |
Awesome! I understand your argument against sudo. It is just a safety precaution i guess. the root user is the first try for hackers. By disabling root login on outside world facing machines to a random username the chances of getting in go down for random attackers. It's the same with bike locks and front door locks. Someone that wants to get in will always find a way. However the more time it takes the more annoyed they get the sooner they'll give up. As an addition i would say google authentication is a nice option to have setup in addition to password and keys. As far as i was able to find this does require a SSH server change to opensshd from dropbear. I do just use 22 and don't bother with changing the port BUT use key+password+google authenticator. and of course fail2ban |
Hmm yeah that is actually true. The same argument than for using a different external SSH port. Although I never feared that one could hit my password, especially since I use key authentication with passphrase, I was just annoyed by those attempts filling my logs. I literally never faced any single brute-force attempts (at least based on regular check/review) after switching to a random port for ~1.5 years. Now I have not opened SSH from web at all, since I simply don't require it. However IF some bot tries your SSH port, then in most cases it will try as root user, that is true! Okay but for completeness indeed then it makes sense to add the recommendation to disable root user login (at least for SSH) completely when opening it to web, even that key authentication makes bot brute-force success practically impossible already. About Two-factor authentication:
|
I don't open up 22 on all my LAN machines. I use one machine (in this case a rpi running dietpi that is why i brought it up :-)) a rpi purely because it is the most energy efficient i had available. This is my "jumphost" and the only one that can be accessed from 1 external IP, a cloud VPS. Both the Cloud VPS and the rpi are setup with key+2fa+password. |
@1985kasper |
Maybe if the Windows version has that option it would be nice. But because the workstation is already on a VPN to access certain work systems i can't risk not being able to access those anymore. And unfortunately some stuff just doesn't work well on a phone for example my routers GUI and apps such as sonarr/radarr don't display very nice on my phone. But anyway it is not so much work to turn a dietpi rpi into the wayi want it to use the above setup. My comment was just more because there might be users that might not understand the power of root and the dangers that come with it especially in combination with a open SSH port. Also i would say ufw is a nice alternative for iptables for the simple stuff. iptables might be throwing people off. It's a pain to remember the syntax even when using it daily :-) |
@1985kasper |
Yes it all went through. Didn't actually have to do any additional steps. After the github failure it worked eventually. I am on 6.24 now. So all looks good |
@1985kasper
It is a snake biting it's own tail:
|
I ran the code. No errors so all seems to be in order. Thanks for the very nice and quick help! Can you possibly looking at my comment on the vlan issue commit aa4a36f? Not entirely sure how it's supposed to work with these drop-ins |
@1985kasper |
Actually i am not sure if this is because of the commands above or a seperate issue. But PHP (installed during the intallation of pihole PRIOR to running these commands) seems to have disappeared. Pihole gives a 503 unavailable error and pihole -d (debug) hangs at php version |
You are using Lighttpd, right? |
Yes it's lighthttpd DietPi:~ $ sudo journalctl -u php7.3-fpm DietPi:~ $ sudo journalctl -u lighttpd @DietPi:~ $ sudo cat /var/log/lighttpd/error.log |
@1985kasper Does
|
Well got it fixed by a purge of PHP and reinstalling. What do you mean by entropy in this context? |
Actually... a reboot killed it again. I'll try the entropy thing |
Ah okay great.... EDIT: ...not. Okay at least it looks very similar to the other issue.
A source for getting random strings basically, required for e.g. cryptography tasks and such. Can be retrieved via |
@DietPi:~ $ sudo systemctl restart php7.3-fpm |
@1985kasper The G_* commands don't work with sudo, because global functions are only loaded in interactive shells.
|
Woops... been at it all day... eyes are getting tired. OK it's installed now |
Creating a bug report/issue
Details:
Additional Information (if applicable)
sed -n 5p /DietPi/dietpi/.hw_model
Steps to reproduce
Expected behaviour
Actual behaviour
Extra details
The text was updated successfully, but these errors were encountered: