I want to be able to login to a remote via ssh without having to enter the password all the time.
- How do I set it up?
- Is a different command required to execute a password-less session?
|
I want to be able to login to a remote via ssh without having to enter the password all the time.
|
|||||||||
|
|
Answer Execute these two commands:
Then you'll need to copy the new key to your server. After the key is copied, ssh into the machine as normal
You can now login without entering a password from the particular machine you executed the commands at. Example
Explanation This assumes you already have successfully connected to your server via SSH. You'll need to generate an SSH Keypair which will allow you to identify you as yourself without using a password. You can opt to protect keys with a passcode if you wish, but this can be left blank allowing totally password-less SSH access. First create your SSH Keypair by running Next copy the public key to your server with References |
|||||||||||||||
|
|
I normally use
|
|||||||||
|
|
If you create a public/pricate keypair und log in using the public key method you will not need to type your password. That is depending on the configuration of your key-ring and ssh agent. Here is one of many short howtos for you. It is of crucial importance to the safety of this method, that the thusly generated private key remains private! |
|||
|
|
|
The way I usually do this is as follows:
(When prompted for a password, leave it blank) Then:
(This requires the folder .ssh to be in the home directory on the targeted hostname, with the authorized_keys file in it) Of course, replace username with the desired username, and hostname with the desired hostname or IP address After that, just SSH to that box just like you're used to. |
|||||
|
|
Type the following commands:
Now you should be able to login without any password. |
||||
|
|