Saturday 31 May 2014

Ubuntu: setup ssh/Winscp with no pass phrase for log-in

Enter the following command at the command prompt:
ssh-keygen -t rsa

At the prompt for entering file in which to save the key, press "Enter".
At the prompt for entering passphrase, press "Enter".
At the prompt for entering same passphrase again, press "Enter".
Screen output: "Your identification has been save in xxx", "Your public key has been saved in xxx".
Type the following command:
cat ~/.ssh/id_rsa.pub >>~/.ssh/authorized_keys

Download ~/.ssh/id_rsa to the local machine.

Open PuTTYgen, use "Load" to load an existing private key file, and save the private key.

In Putty, load a session or set a new session by filling in the server adress and session name, then go to connections -> SSH -> Auth -> browse and select the ppk file under "Private key file for authentication".

In Winscp, load private key under "Private key file" and save the session.

In Linux, download from the server the private key id_rs to ~/.ssh/ of the local machine, and use the command "ssh-add" to add private key identities to the authentication agent.

To save the typing of the user name and the host name, append to ~/.ssh/config of the local machine, the following lines and save:

Host [abbreviated name]
    HostName [dev.example.com]
    Port 22000 (optional; can be omitted)
    User [fooey]
Then it is done!

No comments:

Post a Comment