On Mon, 2020-03-23 at 06:50 +0800, Ed Greshko wrote:
On 2020-03-23 04:36, Samuel Sieb wrote:
> On 3/22/20 1:19 PM, bruce wrote:
> > on the remote VM, I want to create a user "bob". I also want
> > to modify the remote to ssh into the VM as bob, using sshkeys
> > do I have to have a local user on my local linux as "bob"..
> > pretty sure I don't! but I'm not sure where the local ssh key
> > should be placed, to allow me to ssh into the remote using the
> > key. Also, how doe this process work when accessing the remote
> > from other local servers.. I'm assuming, I have to copy the
> > key/files to any box I want to access the remote VM from.
>
> The public key needs to be in bob's .ssh/authorized_keys file. The
> private key needs to be in the .ssh folder of any user on any
> computer that wants to ssh to that account. "ssh bob(a)1.2.3.4" If
> you don't have the private key saved as the default key, then you
> will need to either specify it on the command line or put it in the
> .ssh/config file. If you put it in the config file, you can also
> set it up so you don't need to specify the "bob@" part either. It
> will automatically use that user for that host.
FWIW, I don't copy the private key of a user to any other user's
directory. I find that violates the "private" principle. Each user
has their own public/private key-pair.
Yes, it might seem like more of a hassle but you should generate a
unique private key for each user/computer that you want to connect from
and add all the public keys to bob's authorized_keys file. That way if
you ever need to revoke a key, like a computer is lost or stolen, you
can simply remove the single public key for that user/computer