SSH passwordless login not working after clean install

I’ve successfully installed RancherOS on my bare metal server with my cloud-config. I’ve configured my ssh key as follows:

“ros config set ssh_authorized_keys ‘[ssh-rsa AAA… name@host.domain.com]’”

and install using “ros install -c /var/lib/rancher/conf/cloud-config.yml -d /dev/sd*”

After the install, the server reboots and I am prompted to enter a username and password. When I try to ssh into the machine with rancher@ip-address, it asks for a password. The docs are saying that it should automatically log me in, but that’s not the case. The default password (rancher) is not working. I’m currently locked out of the server.

Are you certain your SSH client is presenting the SSH key you specified?

It might be worth being sure using the -i parameter.

Yes… Here is the output of $ssh -v -i ~/.ssh/id_rsa.pub rancher@ip-address

debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/cabel/.ssh/id_rsa.pub
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password

The key in /Users/cabel/.ssh/id_rsa.pub is what I copied and pasted into my cloud-config.yml as follows:

ros config set ssh_authorized_keys ‘[ssh-rsa AAA… name@host.domain.com]’

@Chris_Abel What version of Rancher are you using?

Would you be willing to try with v0.4.4 that came out on Friday?

I noticed while testing something entirely different today that if you’ve never logged in with an SSH key you should still be able to log in via console/serial using the usual details. Something you can try?

Not for me… Default password rancher does not work.

I had to chmod 400 id_rsa first. Then it worked!

I found out about RancherOS today and was having the same problem.
I am using VMware Workstation, and I followed the steps from the documentation.
basically I started the vm from iso, then created the cloud-config.yml as required (without the rancher@ip, because that’s how it is in the documentation). then installed and rebooted.
the machine itself comes up and the username and password are no longer valid (as described in the documentation).

I tried connecting using a second machine running RancherOS from iso (so I have access to the console), but I get the same results as described by @Chris_Abel. after the ssh key password it requires the rancher@ip user password, which wouldn’t work (tried the default rancher password and an empty password).

I was using the latest RancherOS version.

I’m having the same issue trying to run the recommended rancher AMI on AWS (v0.5.0). It seems that roughly 50% of the time the instance comes up with some ssh problem and I get a password prompt instead of it accepting my ssh key. Rebooting the system generally solves the problem but I have to clear the previous host key in my known_hosts file because it has apparently changed.

@bdentino It seems like you are hitting this issue:

https://github.com/rancher/os/issues/1090

Next time you hit it, could you use the “Get System Log” and share your details in the issue?

One step ahead of you :wink:
https://github.com/rancher/os/issues/1090#issuecomment-231842476

I’m hitting the same issue when trying to connect to a newly created kvm rancheros installation on Proxmox.

Tried it with 0.5.0 yesterday, and 0.6.0 today, not quite sure what I’m doing wrong. Before rebooting to the new install I mounted the harddisk and confirmed the (correct) authorized_key was present in /mnt/var/lib/rancher/conf/cloud-config.d/user_config.yml. The machine seems to come up all right, but I can’t login using my ssh key.

Is there something else I need to configure in the initial cloud-config.yaml instead of the ssh key? Is there a way to enable password login for debug purposes?

I was having this issue until I ssh’d as rancher user and now I’m in!

so instead of ssh -vv -i "<key name>" ec2-ip

I did: ssh -vv -i "<key name>" rancher@ec2-ip

-I