Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Public Key Authentication

Status
Not open for further replies.
Jun 19, 2001
86
0
0
US
I am trying to setup public key authentication. Here is my situation. I am logged in as bob. I need to scp the file as sue.

[bob@box1 directory]$ scp test.txt sue@box2:.

I need to be able to do this without being prompted for a password. Any comments would be greatly appreciated.

Nathan
 
I think this assumes that you are using the same username on both boxes which I am not. Like bob to bob. I am doing bob to sue. See my example.

Nathan
 
well, you should be able to do this as long as the key pairs match in the local .ssh directory files. Just generate the key pairs your coming from, in bobs directory, and paste them into sues directory on the target machine.

___________________________________
[morse]--... ...--[/morse], Eric.
 
Public Key does not have a bias towards the user name signing into the target box. If you have the key, you may log in as the requested user.

HENCE, the public key method is VERY powerful and VERY dangerous if not kept safe.

Surfinbox.com Business Internet Services - National Dialup, DSL, T-1 and more.
 
scp --help indicates the "-i <identity>" flag. man scp explains it. Pass it the user's private key and you should be set.
 
I use:
[tt]
/home/flugh$ scp ./file joe@foo.com:~
[/tt]
It logs me in as user 'joe' on server foo.com. At some point, I did an
Code:
scp ~/.ssh/id_pub.?? joe@foo.com:~/.ssh/authorized_keys
(I don't recall if it was id_pub.rsa or .dsa, whatever).

The punchline is you ssh or scp 'user@sserver', not just 'server' (else ssh assumes same user name).

----
JBR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top