sudo apt-get install openssh-server ssh -l username ipaddresss ifconfig | grep "inet addr"
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.factory-defaults sudo chmod a-w /etc/ssh/sshd_config.factory-defaults sudo vi /etc/ssh/sshd_config
Then add(or change) the lines too read the following (to diable password loging and forwarding and spec limited access)
PasswordAuthentication no AllowTcpForwarding no X11Forwarding no AllowUsers yourRemoteUsername
Then add your key (do it now before restart or you will need a console access)
cat >> .ssh/authorized_keys
paste in the one line with the rsa public key info and then reboot the machine or restart ssh with.
sudo /etc/init.d/ssh restart
Refer:
https://help.ubuntu.com/community/SSH/OpenSSH/Configuring#disable-password-authentication
https://help.ubuntu.com/community/SSH/OpenSSH/Keys
No comments:
Post a Comment