I want to SSH from my host into my guest VM (CentOS). I can Ping.

SSH is running. SSH running

Port 22 is open. Port 22 open

Looks like firewall is off / IPtables are all open. (this is not normal?)enter image description here

When I SSH into my VM. enter image description here

The password IS correct. When I login on VM directly, it works. So I add this to /Users/robbertsegers/.ssh/known_hosts enter image description here

But the problem reproduces.. Is that syntax correct?

  • check directory permission of .ssh and authorized_keys, run this chmod 700 ~/.ssh && chmod 600 ~/.ssh/*
    – Raza
    Jul 31 '14 at 14:42
  • @Robbert Segers can you please post the contents of /etc/ssh/sshd_config?
    – vfbsilva
    Jul 31 '14 at 14:44
  • I ran directory permissions 'chmod 700 ~/.ssh' & 'chmod 600 ~/.ssh/*'. In sshd_conf is basically everything commented out.. What info do you need @vfbsilva?
    – RobSeg
    Jul 31 '14 at 15:03
  • @RobbertSegers do you have anything under AllowUsers?
    – vfbsilva
    Jul 31 '14 at 15:09
  • Not found in sshd_config, also not in ssh_config.. Should I add that line, with IP from host?
    – RobSeg
    Jul 31 '14 at 15:12

In your "sudo" line, the "passwd" prompt is for your local password, not for the remote one. It hasn't started running ssh yet because the sudo hasn't authenticated you yet.

Remove line 3 in your "known_hosts" file and try again.

  • You're right, thank you. passwd is ok now, it was for ssh. I've removed line 3 in known_hosts and problem moves to line 1. After commenting out all but right line, problem still reproduces.. even after commenting out all lines.
    – RobSeg
    Jul 31 '14 at 16:03
  • It looks like you have a non-default config so that unknown keys are not prompted to add try this: ssh -o StrictHostKeyChecking=ask robbert@ It should prompt to add the key to known_hosts (you can say yes).
    – BowlOfRed
    Jul 31 '14 at 16:08
  • It worked! Thank you so much bowlofred, I'd be searching for this for a long time.
    – RobSeg
    Jul 31 '14 at 16:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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