3

I tried to setup a spark cluster environment and when I trying to setup password-free ssh login for user spark, I came across this problem.

I create the user spark by

groupadd spark useradd -g spark spark passwd spark mkhomedir_helper spark then I su - spark and cdand then make the .ssh directory with: mkdir ~/.ssh chmod 700 ~/.ssh

Finally, I use ssh-keygen -t rsa -y to generate the key pairs, then it show /home/spark/.ssh/id_rsa: No such file or directory.

Yes, you see the problem correct, I'm not asking about .ssh/authorized_keys: No such file or directory. I knew that there are tons of posts concerning the famous authorized_keys priviledge setting. But this ~/.ssh/id_rsa: no such file error have almost no information on the web.

Do you have any suggestions? Thank you.

In case it's a version specified bug, I am using OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014. I tried stop apparmor with /etc/init.d/apparmor stop and it's still the same error.

1 Answer 1

9

From man ssh-keygen:

-y      This option will read a private OpenSSH format file and print an 
        OpenSSH public key to stdout.

so it fails because there is no existing id_rsa file.

If you want to create a new RSA key pair, run the command without the -y option, i.e.

ssh-keygen -t rsa
2
  • 1
    Wow...Orz, that's the problem!! I thought the y option is for automatically confirmation. Thank you!! you save my day, I was about to compile newest openssh from scratch..
    – Allan Ruin
    Aug 11, 2016 at 3:31
  • 1
    @AllanRuin yes it's an odd choice of letter since -y means exactly that for several other commands Aug 11, 2016 at 3:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .