apt-get install sshThis will install the openssh client and server. Open sshd configuration file located at /etc/ssh/sshd_config ( in Ubuntu ) using your favourite editor
vi /etc/ssh/sshd_config1. The vast majority of ssh attacks are directed by zombie machines to ssh servers listening on the default port on “22”, so change this number can minimise the attacks to your server.
#Port 22 Port 22332. There is no good reason for root to be allowed to login directly. If you need root access, you should login using a normal user and using su to login as root account.
#PermitRootLogin yes PermitRootLogin no3. Reduce the maximum amount of time allowed to successfully login before disconnecting. 30 seconds should be enough for legitimate users to login into a system.
#LoginGraceTime 120 LoginGraceTime 304. Limit the maximum number of invalid login attempts before disconnecting to boost extra security.
#MaxAuthTries 6 MaxAuthTries 25. By default, sshd allows all users to login into the system. You can list only the certain users can login via SSH ( * stands for everything ).
AllowUsers trevor yijie eric*Exit the vi editor by typing vi command
:wqNow restart the ssh server
/etc/init.d/sshd restartPlease note that you will need root access to do the above operations.