Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am attempting to set up a scenario in which I do not require to submit a password to ssh into an ubuntu machine from a mac. This is procedure i have been following:

1 - Open a terminal in your mac and remain logged in as you, not root.

2 - ssh-keygen (when asked for a password leave blank, the purpose of this s for rsync to be able to ssh without a password prompt)

3 - cat ~/.ssh/id_rsa.pub

This will have made an SSH key which will now be living in your home folder. Now you need to add the public key into the ubuntu VM

1 – Login as root into the vm

2 – mkdir /home/john/.ssh/

3 - nano /home/john/.ssh/authorized_keys copy the key generated on you mac into the ida_rsa.pub and paste into this file

4 – chown –R john /home/john/.ssh/

5 – chmod 600 /home/john

The result of this is, I have the key in both home directories. But when i ssh john@local.mysite.com i still get asked for a pword..

Any ideas?

Is there a config that must be setup in ssh within the ubuntu machine to allow this behaviour to happen?

share|improve this question
    
Can we see the output of ls -la ~john/.ssh on the ubuntu box? Paste it into your question, that way the formatting will be retained. –  MadHatter Dec 11 '13 at 8:57

1 Answer 1

up vote 3 down vote accepted

Here's the problem:

chmod 600 /home/john

You're making your home directory non-executable for yourself, which means that any process owned by you can't enter the directory to read its contents - including your ssh keys.

You want chmod 700 /home/john instead. Also chmod 700 /home/john/.ssh; chmod 600 /home/john/.ssh/*

share|improve this answer
    
Thanks, that was indeed the fault. –  John Dec 11 '13 at 12:30

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.