Want to copy linux files using scp without entering password each time


I am trying to copy files to a server out on the Internet without having to type in a password everytime.  I am going from a local linux (fedora 6) box to another linux box (Cent 4).  My command is:

scp /home/tayloe/filename   tayloe@70.86.x.x:/home/tayloe

It works, but it makes me enter a password each time.  I generated a key pair on the local box (using ssh-keygen -t rsa) and copied the contents of the resulting id_rsa.pub file to a file called authorized_keys on the remote box.  The authorized keys file is in the following 2 directories on the remote box:


I wasn't sure which directory it should be in, so I put it in both.  That procedure is supposed to make it so it stops asking for a password each time, but it still does.  


Who is Participating?
TintinConnect With a Mentor Commented:
Make sure perms on your .ssh directory are 700
Jan SpringerConnect With a Mentor Commented:
scp -i /home/tayloe/.ssh/id_rsa  /home/tayloe/filename  tayloe@70.86.x.x:/home/tayloe/.

And the authorized_keys file belongs in the .ssh directory on the remote.
nociConnect With a Mentor Software EngineerCommented:
Also, if Kerberos is available (&configured) then you can enter your password once for all accesses throughout the kerberos domain.
Enter the password using kinit.
Both ssh & scp are capable of using the kerberos tickets you received.
ssemenyukConnect With a Mentor Commented:

authorized_keys should be in the home directory on the server, i.e. /home/tayloe/.ssh in your case. You can also try creating authorized_keys2, or just symlink it to authorized_keys.

Use either -i option for scp or add
Host 70.86.x.x
  IdentityFile  /home/tayloe/.ssh/id_rsa

to /home/tayloe/.ssh/config on your client box

tayloenicAuthor Commented:

Problem is solved.  I had permissions set too permissive on the server.  I didn't know they could be too permissive!!  I gave tintin the most points because he gave the correct answer even though it took me a while to figure that out.  Thanks to all for responding.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.