27

The remote server only allows account X to ssh to. Now, from my computer, I want to ssh to the remote server as account X without password. I generate the private key on my local computer and share the public key to the remote server as the tutorial

However, the private key and public key are only applied for my account. Is it possible to make these keys as account X ?

What I am going to do is create an account X on my local computer. Login as account X, then ssh-keygen for account X.

Note: my computer is Mac, my server is Linux

2 Answers 2

27

What I am going to do is create an account X on my local computer. Login as account X, then ssh-keygen for account X.

No, what you're going to do is rather useless. The server doesn't know anything about your local account name (like it used to in the rsh days); the ssh client merely uses it as the default login name it'll try, and the ssh-keygen tool merely puts it in the "comment" field which isn't used for anything at all.

If you want to log in to the server as account X, just ask ssh to do so:

ssh X@myserver

This will make the server check your password or pubkey against the remote user X's information.

0
9

Does setting the -l flag not work?

i.e. $ ssh host -l username

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .