Closed computershateme closed 5 months ago
Hey, @computershateme! What you want to do should be entirely possible. Are you sure the key did actually end up in /root/.ssh/authorized_keys
? Just to clarify, do you want to log in as root using your own user's key or does the root user on your system have a key that you're trying to use?
If it's the former, try this:
multipass exec instance-name -- sudo bash -c "echo `cat ~/.ssh/id_rsa.pub` >> /root/.ssh/authorized_keys"
if it's the latter, try this:
multipass exec instance-name -- sudo bash -c "echo `sudo cat /root/.ssh/id_rsa.pub` >> /root/.ssh/authorized_keys"
Awesome, thank you so much. Apparently my keys were not getting through to the root user because I wasn't putting the sudo in front of bash or cat. Thank you and you can close this ticket.
I'm glad it worked!
Describe the bug Inability to SSH in as root
To Reproduce
cat path/to/id_rsa.pub
>> /root/.ssh/authorized_keys” on host, get back an empty lineExpected behavior SSH into instance as root user
Logs Please provide logs from the daemon, see accessing logs on where to find them on your platform.
Additional info
Additional context Add any other context about the problem here.