0

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:

  1. I created pub/pri key using ssh-keygen, they are placed under $HOME/.ssh/ (abc.xyz@domain.com user usually creates a key names as abcxyz and abcxyz.pub) on VM1
  2. 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?

John
  • 351
  • 5
  • 18
  • 1
    ssh-copy-id is used to setup key for passwordless access (and you have to use password to do this). but vm2 is configured to use keys only (without passwords). **here is quote from man:** ```ssh-copy-id is a script that uses ssh(1) to log into a remote machine (presumably using a login password, so password authentication should be enabled```. To solve such stalemate you need to use extra privileged user to [setup such keys without use of ssh-copy-id](https://superuser.com/a/978182/1117244). BTW, StackOverflow is dedicated to software development and you question is off-topic here – Maxim Sagaydachny Apr 28 '20 at 05:09
  • @MaximSagaydachny Thank you for the link and I have flagged the question to move to SuperUser – John Apr 28 '20 at 07:08

0 Answers0