So I set up an arch server for the second time and scribbled down what I needed to do. Maybe it is useful for someone else. Also - feedback appreciated.
Only disabling the execute permissions (600) could still allow someone to upload a new key from your computer when that computer would have your key loaded.
You might also want to bring some consistency in your documentation:
e.g. you make the william user, but you give sudo to the ruben user, or you set the ssh port to 66677 in the linked page, but when you discuss the firewall rule for ssh you suddenly have 12345 as port.
As a bonus maybe you could add some more links to the Arch wiki for each part (ssh, ssh-keys, ...) that way it will also become very handy to double check.
Use AIDE (Advanced intrusion detection environment) for file integrity.
Configure iptables to whitelist traffic.
Add email notification on user logins.
21 comments
You can use:
From a PC with your public key on it instead of scp-ing your .pub file.
Nice - new thing for me. Will update accordingly.
Is in the guide although the user is named william
Specified port is also incorrect.
This is the kind of thing I should remember - still it keep falling out of my head....
oops - will fix.
One tip: don't set the sshd port >1024, because then non-root (and malicious) applications could impersonate it.
I thought it was anything over 1000, not 1024?
Nope, 1024. The CAP_NET_BIND_SERVICE capability is described as:
From http://man7.org/linux/man-pages/man7/capabilities.7.html
Aha - makes sense. Will update.
https://github.com/gh2o/digitalocean-debian-to-arch
I found out this was a thing a while ago, haven't tried it yet, already have a VPS at linode too.
Recently used it a few weeks ago, and it worked great!
I'm surprised no one has mentioned the Arch Wiki article on security: https://wiki.archlinux.org/index.php/Securing_Arch_Linux
Deleted before we saved it.
So I set up an arch server for the second time and scribbled down what I needed to do. Maybe it is useful for someone else. Also - feedback appreciated.
Set the permissions for the authorized_key file to read only. See the arch wiki https://wiki.archlinux.org/index.php/SSH_keys#Securing_the_authorized_keys_file
Only disabling the execute permissions (600) could still allow someone to upload a new key from your computer when that computer would have your key loaded.
You might also want to bring some consistency in your documentation: e.g. you make the william user, but you give sudo to the ruben user, or you set the ssh port to 66677 in the linked page, but when you discuss the firewall rule for ssh you suddenly have 12345 as port.
As a bonus maybe you could add some more links to the Arch wiki for each part (ssh, ssh-keys, ...) that way it will also become very handy to double check.
Thanks - good suggestions. I sprinkled the post with links and tried to make it more consistent.
Deleted before we saved it.
Use AIDE (Advanced intrusion detection environment) for file integrity. Configure iptables to whitelist traffic. Add email notification on user logins.
Good suggestions. I will look into this a bit more.