Thursday, March 1, 2012

SSH without manually input password

On client side generate the ssh key:


client$ cd ~/.ssh
client$ ssh-keygen -q -f id_rsa -t rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:

Copy the public key to the server:


# Step 1:
client$ scp ~/.ssh/id_rsa.pub user@your.ssh.server:~/.ssh/tmpfile

# Step 2:
server$ chmod 700 ~/.ssh
server$ cat ~/.ssh/tmpfile >> ~/.ssh/authorized_keys
server$ chmod 600 ~/.ssh/authorized_keys
server$ rm ~/.ssh/tmpfile

No comments:

Post a Comment