Hi All,
I was able to create a public key for one of my servers that I log into frequently.
Now I want to do this for a few more servers (where I use the same user id) and my user id on my laptop is the same as the servers.
I also want to use PKA for other users accounts on the servers (for website editing and SFTP transfers) where my id on my laptop does NOT match the user on the server.
I dont see at all how to make these changes as I already have an id_rsa and id_rsa.pub.
So as an example:
my user id on my laptop is: jtsm and the user id i want to log into the server as is: wwwdata
Can anyone shed some light on how to setup multiple PKA on a single laptop with a single user account connecting as multiple user accounts to the server?
-Jason
On 08/03/2011 12:51 PM, Todd wrote:
Hi All,
I was able to create a public key for one of my servers that I log into frequently.
Now I want to do this for a few more servers (where I use the same user id) and my user id on my laptop is the same as the servers.
I also want to use PKA for other users accounts on the servers (for website editing and SFTP transfers) where my id on my laptop does NOT match the user on the server.
I dont see at all how to make these changes as I already have an id_rsa and id_rsa.pub.
So as an example:
my user id on my laptop is: jtsm and the user id i want to log into the server as is: wwwdata
Can anyone shed some light on how to setup multiple PKA on a single laptop with a single user account connecting as multiple user accounts to the server?
-Jason
Since you've already generated an SSH key pair, you can add the public portion of your key to the authorized_keys file for each of the accounts to which you will be connecting. For example, say I have two accounts on a server, jleafey and webapps. All I would need to do is to concatenate the public key (id_rsa.pub) to the .ssh/authorized_keys file for each of those accounts. I would then specify the username when I connect, i.e. "ssh webapps@server" or "ssh jleafey@server".
This is very easy to do if you are using the OpenSSH client. If you are using Putty under Windows there is a configuration entry where you can specify the username under which you are connecting.
YMMV!
I also want to use PKA for other users accounts on the servers (for
website editing and SFTP transfers) where my id on my laptop does NOT match the user on the server.
Since you've already generated an SSH key pair, you can add the public portion of your key to the authorized_keys file for each of the accounts to which you will be connecting. For example, say I have two accounts on a server, jleafey and webapps. All I would need to do is to concatenate the public key (id_rsa.pub) to the .ssh/authorized_keys file for each of those accounts. I would then specify the username when I connect, i.e. "ssh webapps@server" or "ssh jleafey@server".
ah ha, I can cat id_rsa.pub >> ~/.ssh/authorized_keys for each user account on the server
Thank you!
I also want to use PKA for other users accounts on the servers (for
website editing and SFTP transfers) where my id on my laptop does NOT match the user on the server.
Since you've already generated an SSH key pair, you can add the public portion of your key to the authorized_keys file for each of the accounts to which you will be connecting. For example, say I have two accounts on a server, jleafey and webapps. All I would need to do is to concatenate the public key (id_rsa.pub) to the .ssh/authorized_keys file for each of those accounts. I would then specify the username when I connect, i.e. "ssh webapps@server" or "ssh jleafey@server".
ah ha, I can cat id_rsa.pub >> ~/.ssh/authorized_keys for each user account on the server
Thank you!
On 08/04/2011 04:28 AM, Todd wrote:
ah ha, I can cat id_rsa.pub >> ~/.ssh/authorized_keys for each user account on the server
You might want to have a look at
/usr/bin/ssh-copy-id [-i [identity_file]] [user@]machine It takes care of directory/file creation, permissions, selinux etc
Kal