Score:0

Allow users in chroot to SSH to another VM instance

tr flag

Been coming across some issues with setting up SSH from a chroot directory out to a secondary VM. This is all being done in Google Cloud at the moment using CentOS 8. I think I have created the chroot directory correctly, added /bin/ssh to the chroot directory, added shared libraries for /bin/ssh.

I am stuck currently at running ssh <IP_ADDRESS>. I had to first create a /home/<USER>/.ssh in the chroot, then I added a known_hosts file inside .ssh. I connected to the second VM and can see that a host was added to the known_hosts file but I cannot get past an error about <USER>@<IP_ADDRESS> Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

Password authentication is disabled currently in sshd_config on both VM instances. I remember briefly trying password authentication with both and it still failed. I am not sure of what I am missing to resolve this.

John Hanley avatar
cn flag
To login to a remote machine with SSH key pairs requires placing the public key on the remote host and the private key on the local host. Did you do that?
rk92 avatar
tr flag
Thanks, yes that was part of the problem. Manually created a SSH key pair on the Bastion, was able to get the public key to the second instance and private key was added to the chroot directory. I also needed to add a `/tmp` folder to my chroot directory along with `/bin/ssh-add` and `/bin/ssh-agent` along with associated shared libraries (ldd) for ssh-add and ssh-agent.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.