FYI, when I have followed the instructions for setting up ssh passwordless login using ssh-kgen given at the link below, it has always gone well for me:

https://www.tecmint.com/ssh-passwordless-login-using-ssh-keygen-in-5-easy-steps/

First, you might want to check if you have the following files and file permissions similar to:

username@computername:~$ ls -al ~/.ssh
total 24
drwx------  2 username username 4096 Oct 28 23:54 .
drwxr-xr-x 68 username username 4096 Oct 28 23:54 ..
-rw-rw-r--  1 username username  401 Oct 28 23:54 authorized_keys
-rw-------  1 username username 1679 Oct 28 23:50 id_rsa
-rw-r--r--  1 username username  401 Oct 28 23:50 id_rsa.pub
-rw-r--r--  1 username username  222 Oct 28 23:47 known_hosts

Second, you might try removing all the files in .ssh to start over:

username@computername:~$ rm ~/.ssh/*

After removing all the files in the .ssh folder, it prompts me again for my password:

username@computername:~$ ssh localhost
The authenticity of host 'localhost (127.0.0.1)' can't be established.
ECDSA key fingerprint is blah blah.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
username@localhost's password:
...
Last login: Sun Oct 28 23:39:38 2018 from 127.0.0.1
username@computername:~$ exit
...

Next, I setup the ssh-keygen on the client hostname (e.g. localhost), then I copy authorized_keys to the remote hostname (e.g., localhost <- Usually, this has to be done using the hostname for each of your nodes.  In this case, it only has to be done once and it connects back to the same localhost.):

username@computername:~$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/username/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/username/.ssh/id_rsa.
Your public key has been saved in /home/username/.ssh/id_rsa.pub.
The key fingerprint is:
blah blah username@computername
The key's randomart image is:
+---[RSA 2048]----+
|      o  o       |
|       ()        |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
|                 |
+----[SHA256]-----+

username@computername:~$ cat ~/.ssh/id_rsa.pub | ssh localhost 'cat >> ~/.ssh/authorized_keys'
username@localhost's password:
username@computername:~$ exit
logout
Connection to localhost closed.

It works as it no longer prompts for a password (i.e., it no longer stops with "username@localhost's password:" when connecting):

username@computername:~$ ssh localhost
...

Last login: Sun Oct 28 23:49:28 2018 from 127.0.0.1
username@computername:~$exit

Finally, "ls -al ~/.ssh" gives the files and file permissions that were first shown above.

On 10/28/2018 9:53 AM, Peter Blaha wrote:
Remove the config file.

Your username seems to be:  User

You don't want a     user localhost

localhost is the hostname, not the username.


-------- Weitergeleitete Nachricht --------
Betreff:     [RE]Re: [Wien] Fail to parallel calculation of lapw1 and lapw2 (testpara1 and testpara2)
Datum:     Mon, 29 Oct 2018 00:48:47 +0900 (KST)
Von:     Woohyeon Baek <wh8...@knu.ac.kr>
An:     pbl...@theochem.tuwien.ac.at



Dear Peter Blaha,


I set 'User localhost' in config file.


Sorry, I mistyped authorized_keys as key_authorized in mailing.


Anyway I retried


1. ssh-keygen –t rsa
2 .append .ssh/authorized_keys on remote host with id_rsa.pub of local host


In 'Installation of Wien2k, parallelization, large scale applications with WIEN2k' your presentation file.


But it still requires password.

-----------------------------------

[User@localhost .ssh]$ ssh localhost
localhost@127.0.0.1's <mailto:localhost@127.0.0.1's> password:

------------------------------------


Are there any more steps that I need to perform?



Sincerely,


Woohyeon Baek

_______________________________________________
Wien mailing list
Wien@zeus.theochem.tuwien.ac.at
http://zeus.theochem.tuwien.ac.at/mailman/listinfo/wien
SEARCH the MAILING-LIST at:  
http://www.mail-archive.com/wien@zeus.theochem.tuwien.ac.at/index.html

Reply via email to