Passwordless ssh

Hi

I have created a user on a linux server and created a passwordless ssh key. I've echoed the key into the authorized_keys file for the user.
I've added a series of forced commands to the key.

From my laptop - logged in as myself - I can ssh into the server as that user and the commands are executed.

All well and good.

How can I alter the key to accept ssh connections as that same user, but from any machine on my network?

At the moment, the key ends with myuser@mylaptop

If I try to ssh from my other laptop as the same user I am prompted for a password and then the command fails.

Thanks in advance

Steady

  1. login into every server on the network. make keys. copy the keys to one location.
    each key with a unique name
  2. if you have 10 servers, you will need ten separate keys.
  3. combine all those keys into one file with
cat keyfilename1 keyfilename2 ... keyfilename_last >> authorized_keys
  1. copy that one authorized_keys file back to every server, into the .ssh directory.

The >> is there in case you decide to use an existing real authorized_keys file, otherwise just use >.

authorized_keys only works if the client actually has the key that's been authorized.

Other systems will either need the same key under ~/.ssh/, or new keys which also must be added to authorized_keys on the remote host.

1 Like

Thanks Guys

Much appreciated