Just another WordPress.com site
This how-to will show you how you connect to a Linux machine via SSH using a key, instead of the password. This is very useful for creating scripts to connect to the machines for file transfer, backup and more and save you the work of the password every time SSH to a machine type.
This guide assumes that you have an SSH server configuration in “Server” and an SSH client to configure the client.(sudo apt-get install openssh-server & sudo apt-get install openssh-client, respectively)
Firstly, by the client, run the following command on record with your normal user account:
(The password blank if you do not want to provide the login, but remember to save the certificate that is created with your life when you open the door for someone who finds you …)
This creates and id_rsa id_rsa.pub are automatically converted to the directory ~/SSH.
Then we want to load the pub external file host/server to which you want to connect:
SCP ~/.ssh/id_rsa.pub remoteuser @ remotehost was contained: ~/
Now that you’ve uploaded may allow connection to the remote computer (ssh user @ remotehost was contained) and perform the following on the remote host:
Cat > pub > id_rsa.~/.ssh/authorized_keys
delete the uploaded file.
If the authentication of the remote host key is not enabled (default), machine and change the ssh configuration file as such:
and add/change the following options such as:
Then Reload the configuration:
You are now ready to test to make sure that you can via the main open and if necessary, you can disable password authentication.
Change the setting again:
and set the following options:
Setting usepam not
Reload the configuration:
It is now on its way to more secure/hassle free SSH authentication.
Technorati Tags: SSH key authentication,