Are there any relevant messages in /var/log/security or /var/log/messages?
I'll have to look when I get home after work, thanks for the pointer.
South Africa’s biggest forum. Discuss, discover, and connect with thousands of members.
Are there any relevant messages in /var/log/security or /var/log/messages?
Tried Webmin last night. Worked like a bomb![]()
Don't use passwords. Add public key to authorized_keys file. No good to have a shutdown script that requires the user's attention.
I have created 3 different users, with the most simple of passwords.
maakoopasb
maakoop1
Etc
No luck.
There is more info on the thread about the home Server of mine don't want to hijack ockies thread.
Doesn't the actual shutdown command require you to enter a password? I honestly can't remember, just wondering.
ssh root@machine "shutdown -h now"
ssh -o ConnectTimeout=10 root@machine "shutdown -h now"
ssh -o ConnectTimeout=10 user@machine "sudo shutdown -h now"
I get this issue
View attachment 231526
my guess is you are not hitting the server you think you are trying to access. Maybe a NAT issue and you are actually trying to log into a router?
Typically this will happen when you configure dynamic dns without port forwarding or you try to access the server from inside your home network using the wan ip.
Nope. You can just run this:
Code:ssh root@machine "shutdown -h now"
If you have key access it shuts down immediately.
Also good idea to add a shorter time-out so the command doesn't wait too long if the system is not responding.
Code:ssh -o ConnectTimeout=10 root@machine "shutdown -h now"
This example uses root, but sudo works fine for non-root users:
Code:ssh -o ConnectTimeout=10 user@machine "sudo shutdown -h now"
why leave sshd listening on port 22 and inviting allsorts to try and hack it?
move it to a nonstandard port (222 or 2222)...
why leave sshd listening on port 22 and inviting allsorts to try and hack it?
move it to a nonstandard port (222 or 2222)...
Obscurity is not security! Nmap will show you all the open ports.
fail2ban
Yip it does, makes my life easier.Works like a charm.
I normally leave it as 22 internally as it's just much easier that way, but will often Port Forward from another port so 22 never even hits my server.