You are not logged in.
Pages: 1
I've recently been introduced to ssh and have set it to only be accessed locally. I want to move away from this and let my computer be accessed by me anywhere i am. Could someone list a few features that i would want to have on my ssh server so it is extremely secure. Currently i have the following:
MaxSessions set to 3
Protocol 2
The default port changed
I have set up fail2ban to monitor the access to my ssh server
I know that it really isn't much, but what more would i need to add to make my server secure?
Offline
Offline
Disable password login and use ssh keys.
If i understand this correctly, this is more secure because my server will only accept keys that have been added by me right?
Disable X11 forwarding and root logins. You could also look into port-knocking.
I never had any use for X11, so i never bothered to install it and i've removed root login aswell. Could you please explain port-knocking?
Offline
Daenyth wrote:Disable password login and use ssh keys.
If i understand this correctly, this is more secure because my server will only accept keys that have been added by me right?
Yes. You generate a private key and a public key. After that, you put your public key to ~/.ssh/authorized_keys (on the server). Now you can login with your private key. It is more secure than a passwort (cause it is longer).
Offline
Could you please explain port-knocking?
You can find a good explanation here: http://www.portknocking.org/. Port knocking is somewhat unnecessary but, if you are paranoid, adds some extra security.
Offline
dozerismydogsname wrote:Could you please explain port-knocking?
You can find a good explanation here: http://www.portknocking.org/. Port knocking is somewhat unnecessary but, if you are paranoid, adds some extra security.
Read up on it and it sounds really good. The only question i have now is how would i precede to doing this for my ssh server?
Offline
Instructions are here: http://www.zeroflux.org/projects/knock
You can install knockd from aur.
Offline
Instructions are here: http://www.zeroflux.org/projects/knock
You can install knockd from aur.
So how exactly would i do this knock on a computer trying to access my computer via ssh?
Offline
So how exactly would i do this knock on a computer trying to access my computer via ssh?
You don't. The client knocks on the server.
The point of port knocking is to dynamically open ports only when a client "knocks" on a specific sequence of ports. This way, if an attacker does not know the "knock", he/she will be unable to establish a connection with the ssh server in the first place and will not even know if it exists.
An alternative to the classic port knocking is single packet authentication. The basic idea is the same as port knocking but is slightly more secure. The project page is here: http://www.cipherdyne.org/fwknop/docs/gpghowto.html.
Read the documentation on these projects respective websites for further details; they explain things much better than I can.
Offline
dozerismydogsname wrote:So how exactly would i do this knock on a computer trying to access my computer via ssh?
You don't. The client knocks on the server.
The point of port knocking is to dynamically open ports only when a client "knocks" on a specific sequence of ports. This way, if an attacker does not know the "knock", he/she will be unable to establish a connection with the ssh server in the first place and will not even know if it exists.An alternative to the classic port knocking is single packet authentication. The basic idea is the same as port knocking but is slightly more secure. The project page is here: http://www.cipherdyne.org/fwknop/docs/gpghowto.html.
Read the documentation on these projects respective websites for further details; they explain things much better than I can.
I don't think that i phrased my question right, so sorry about that. But i was asking the follownig: is there a particular command that a client would have to use to complete the "knock"?
Offline
Sequence:
The client runs a command to "knock" on the server. If the knock is correct, the server opens a predesignated port (for example, your ssh port) to the clients current ip address. The client can now establish a connection with the server. Established connections will never be severed.
Commands:
knock is the accompanying port-knock client, though telnet or netcat could be used for simple TCP knocks instead. For more advanced knocks, see sendip, packit, or hping.
Now, to gain access to sshd, we execute fwknop:
[spaclient]$ fwknop -A tcp/22 --gpg-recip ABCD1234 --gpg-sign 1234ABCD \
-R -D <host>
Everything and the kitchen sink:
The manuals on their respective websites.
Offline
Sequence:
The client runs a command to "knock" on the server. If the knock is correct, the server opens a predesignated port (for example, your ssh port) to the clients current ip address. The client can now establish a connection with the server. Established connections will never be severed.Commands:
knockd's homepage wrote:knock is the accompanying port-knock client, though telnet or netcat could be used for simple TCP knocks instead. For more advanced knocks, see sendip, packit, or hping.
fwknop's GnuPG tutorial wrote:Now, to gain access to sshd, we execute fwknop:
[spaclient]$ fwknop -A tcp/22 --gpg-recip ABCD1234 --gpg-sign 1234ABCD \
-R -D <host>Everything and the kitchen sink:
The manuals on their respective websites.
Thanks for the help, i really appreciate it.
Offline
Pages: 1