Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
    
check directory permission of .ssh and authorized_keys, run this chmod 700 ~/.ssh && chmod 600 ~/.ssh/* –  Raza Jul 31 at 14:42
    
@Robbert Segers can you please post the contents of /etc/ssh/sshd_config? –  vfbsilva Jul 31 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? –  Harbinger Jul 31 at 15:03
    
@RobbertSegers do you have anything under AllowUsers? –  vfbsilva Jul 31 at 15:09
    
Not found in sshd_config, also not in ssh_config.. Should I add that line, with IP from host? –  Harbinger Jul 31 at 15:12

1 Answer 1

up vote 2 down vote accepted

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.

share|improve this answer
    
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. –  Harbinger Jul 31 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@192.168.0.107. It should prompt to add the key to known_hosts (you can say yes). –  BowlOfRed Jul 31 at 16:08
    
It worked! Thank you so much bowlofred, I'd be searching for this for a long time. –  Harbinger Jul 31 at 16:28

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.