Ubuntu server allow login via ssh with key
The environment:
- Ubuntu server 12.04 LTS is running on VMWare Fusion with IP address 192.168.1.101 as Host
- Mac OS X Mountain Lion as Client
In your ubuntu server
Install ssh server
1 | $ sudo apt-get install openssh-server |
In OS X
Generate a key-pair
1 | $ mkdir ~/.ssh |
Copy the public key id_rsa.pub to Ubuntu server
1 | $ scp ~/.ssh/id_rsa.pub user@192.168.1.101:/home/user/.ssh/authorized_keys |
If everything OK, now you can access via SSH without password
1 | $ ssh user@192.168.1.101 |
Enjoy :)
Reference: SSH/OpenSSH/Keys