[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

scp without password

Posted on 2007-08-10
13
Medium Priority
?
1,267 Views
Last Modified: 2012-06-27
scp question.

I have a fedora core 3 pc and a CentOS 5 pc. I want to be able to scp a file from the FC3 pc to the CentOS 5 pc. I have tried generating rsa keys on the FC3 pc and scp the *.pub file to the CentOS5 pc and copied the info to a authorized_keys file. But when I log into the CentOS 5 I still get promted for the password. I've also tried renaming the authorized_keys to authorized_keys2 and chmod 777 to the key file but still get prompted. I also have restarted the sshd service. Any help is appreciated.
0
Comment
Question by:wilsj
  • 4
  • 4
  • 2
  • +3
13 Comments
 
LVL 19

Expert Comment

by:alextoft
ID: 19672620
Have you tried ssh -v user@host to get the verbose info which might point to the problem?
0
 
LVL 5

Author Comment

by:wilsj
ID: 19672674
This is what I get. When I generated the keys and it asked to specify a password I just hit enter. That should leave it blank correct?

debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to summit-u01 [192.168.7.226] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type 1
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.3
debug1: match: OpenSSH_4.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_3.9p1
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'summit-u01' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:2
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: gssapi-with-mic
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Offering public key: /root/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-with-mic,password
debug1: Trying private key: /root/.ssh/id_dsa
debug1: Next authentication method: password
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 19672903
Hm, try on the server side account
chmod 0700 .ssh
chmod 0644 .ssh/authorized_keys
Helped?
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
LVL 5

Author Comment

by:wilsj
ID: 19672974
I Still get the same thing. if it helps at all this is the command I issued ssh-keygen -t rsa. And the versions of ssh

OpenSSH_3.9p1, OpenSSL 0.9.7a Feb 19 2003 FC3pc

OpenSSH_4.3p2, OpenSSL 0.9.8b 04 May 2006 CentOS5 pc
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 19673000
Can You do that on the server side?
/etc/init.d/sshd stop
sshd -d # will log debug messages to stdout, maybe You'll find something
then try connecting from client.
After that start the sshd in normal mode again
/etc/init.d/sshd start
0
 
LVL 7

Expert Comment

by:ezaton
ID: 19674409
Try the following:
1. dsa keys
2. On the client - Make sure .ssh directory has permissions 700 and your .ssh/id_rsa file has permissions 600.
0
 
LVL 27

Expert Comment

by:Nopius
ID: 19675017
In that case better to debug both server and client side. So follow ravenpl's comment to start server in debug mode and follow alextoft's comment to connect from client in debug mode.
Also ensure, that you have enabled rsa authentication on server 'RSAAuthentication yes'.

Server log in that case should be more helpfull. But be aware that after client's disconnect your sshd with '-d' will die and you may loose connectivity.
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 19675024
> debug1: Next authentication method: publickey
> debug1: Trying private key: /root/.ssh/identity
> debug1: Offering public key: /root/.ssh/id_rsa
Looks like client is trying, that's why I suggested server debug now.
0
 
LVL 5

Author Comment

by:wilsj
ID: 19686781
should i be generating the keys from the fc3 box or the centos5? I want to connect to the centos5 from fc3.
0
 
LVL 43

Accepted Solution

by:
ravenpl earned 2000 total points
ID: 19686883
You are generating keys on client. In your case fc3 box.
0
 
LVL 5

Author Comment

by:wilsj
ID: 19687458
This is what i get when i do sshd -d

sshd re-exec requires execution with an absolute path
0
 
LVL 27

Expert Comment

by:Nopius
ID: 19688820
run it with absolute path:
`which sshd` -d
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

We all know how boring and exhausting it is to transfer huge web projects developed locally to a webserver simply via FTP. The File Transfer Protocol is a really nice solution if you need to transfer small amounts of files, but if you're plannin…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Viewers will learn how to properly install and use Secure Shell (SSH) to work on projects or homework remotely. Download Secure Shell: Follow basic installation instructions: Open Secure Shell and use "Quick Connect" to enter credentials includi…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
Suggested Courses
Course of the Month19 days, 22 hours left to enroll

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question