There are some things you need you take care for your secure:
- fail2ban
- http://www.servermom.com/how-to-install-fail2ban-to-protect-server-from-brute-force-ssh-login-attempts-ubuntu/370/
- Generate SSH Public Key
- Your computer
- cd .ssh
- ssh-keygen -t dsa
- Enter file in which to save the key (/home/shin/.ssh/id_dsa): your-name
- Enter passphrase (empty for no passphrase): your-hard-password
- Enter same passphrase again: re-type-your-hard-password
- We have your-name.pub file in .ssh folder, and copy it to your-server
- scp your-name.pub your-server-username@your-server:./your-name.pub
- scp your-name.pub your-server-username@your-server:./your-name.pub
- --OR--
- scp -P[port] your-name.pub your-server-username@your-server:./your-name.pub
- E.G.:
- my.pub my@server:./my.pub
- my.pub my@server:./my.pub
- my.pub -P22 my@server:./my.pub
- Type your password on your server
- Your server
- touch .ssh/authorized_keys
- sudo chmod 600 .ssh/authorized_keys
- cat your-name.pub >> .ssh/authorized_keys
- rm your-name.pub
- Try to access your-server using SSH Public Keys
- ssh your-server-username@your-server
- Type your-password when create your-name.pub file
- Limit users can not access your-server using ssh
- sudo vim /etc/ssh/sshd_config
- AllowUsers <user1> <user2>
Good luck!
No comments:
Post a Comment