I have a Public IP VM (VM1) and Private IP VM (VM2) under same virtual network. My goal here is to enable users to login to VM1 through Azure Active Directory and once they are inside they can SSH to VM2 from VM1 using ssh keys. I followed these steps:
- I created pub/pri key using
ssh-keygen
, they are placed under$HOME/.ssh/
(abc.xyz@domain.com
user usually creates a key names asabcxyz
andabcxyz.pub
) on VM1 - Then i tried to
ssh-copy-id -i $HOME/.ssh/abcxyz abcxyz@<vm2_ip>
In step 2 I get error abcxyz@<vm2_ip>: Permission denied (publickey)
. Any idea what step i missed?