Computing.Net > Forums > Unix > SCP and setting up keys

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

SCP and setting up keys

Reply to Message Icon

Name: wizard0447
Date: January 14, 2004 at 04:33:16 Pacific
OS: Solaris
CPU/Ram: gig
Comment:

Hi. I am about ready to pull my hair out. I am not sure what my problem is, but I worked on getting scp working for about a day and a half strait, and have gotten virtually no where.

I have 2 solaris servers. I will refer to the one I would like to scp to the "Server" and the one I am scp'ing from the "Client"

I generated keys on the server and the client using the command

ssh-keygen -t rsa -f /home/pmarshal/.ssh/id_rsa -N ""

On the server machine, I made a file in the .ssh dir called authorized_keys and added the public key from the client to it.

On the Clien machine, I added a file in the .ssh dir called known_hosts and aded the publick key of the server to it.

I also have a file on the client called server_pub that contains the public key of the server

I try to scp with the following command
scp -Bi srever_pub /home/pmarshal/temp/* pmarshal@server:/home/pmarshal/temp2

If anyone could shed some light on what I am doing wrong, I would GREATLY appriciate it.

I can ssh, but it uses the keys in /usr/local/etc. (I know this because it takes the public key from there and sticks it in my known_hosts file)

Thanks again
Peter



Sponsored Link
Ads by Google

Response Number 1
Name: thatcher
Date: January 27, 2004 at 15:19:45 Pacific
Reply:

I had some problems as well, but now it works and I know why.

as soon as normal ssh user@server works with a passwd known_hosts is OK.

1) take a look in your sshd config file (ex: /etc/ssh/sshd_config) to see what file it looks for as "AuthorizedKeysFile" this should be something like: "%h/.ssh/authorized_keys", where it doesn't matter which protocol version you use.

2) put the public key generated on your client in the homedir/.ssh of the user you want to use on the server and make sure it has the same name as specified in the config file (notice that on some servers you are not allowed to login as root). Then set the file permissions of the .ssh dir to 755 and of the authorized_keys file to 644.

I think this should help...


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Unix Forum Home


Sponsored links

Ads by Google


Results for: SCP and setting up keys

I'm setting up webhosting! www.computing.net/answers/unix/im-setting-up-webhosting/3374.html

.cshrc file and setting up aliases www.computing.net/answers/unix/cshrc-file-and-setting-up-aliases-/6445.html

Setting up the net in linux www.computing.net/answers/unix/setting-up-the-net-in-linux/33.html