It is possible to add the password to the ssh config in order not to type any more the password every time I am going to login to the remote host?
1 Answers
Try this...
Use defaults w/o passphrase... that will give you passwordless SSH. This is ideal for a system that is well secured or possibly in a home environment. If you enter a passphrase, you can use a ssh-agent by spawning ssh-add on the load of your gui session. This will manage your keyring by using a single passphrase and even for the passphrases you have with ssh keys, you will no longer be prompted to enter them when you ssh to clients that have the SSH Key pushed.
This is a key-based Authentication... which is more secure than just popping the password into files.
[fedodora@server ~]$ ssh-keygen -t rsa
[fedodora@server ~]$ ssh-copy-id -i .ssh/id_rsa.pub fedodora@newserver
The authenticity of host 'newserver (X.X.X.X)' can't be established.
RSA key fingerprint is ab:cd:ef:12:34:56:78:90:1f:4d:d9:ff:2e:5f:97:8d.
Are you sure you want to continue connecting (yes/no)? yes
fedodora@newserver's password: {enter your remote server user's password here}
Warning: Permanently added 'newserver,X.X.X.X' (RSA) to the list of known hosts.
Now try logging into the machine, with "ssh 'fedodora@newserver'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
You can use -v to verify the debug output from SSH to see that there are several authentication mechanisms tried. This one is referred to as PublicKey for SSH.
[fedodora@server ~]$ ssh -v newserver
You should get a trailing output like this just before your SSH session connects.
debug1: Next authentication method: publickey
debug1: Trying private key: /home/fedodora/.ssh/identity
debug1: Offering public key: /home/fedodora/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_US.UTF-8
Last login: Day Month Date HH:MM:SS YYYY from X.X.X.X

- 131