The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
FreeBSD Support
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 Re: scp without password prompt
Author: halber_mensch 
Date:   23-11-05 16:45

Sure thing. Let's say you are connecting from foo@bar to foo@baz.

Use ssh-keygen on bar as the foo user to create an ssh key first - I use 512 bit dsa keys, but you can do whatever you please:

foo@bar$ ssh-keygen -b 512 -t dsa

ssh-keygen will prompt you for the location to store the key, you can go ahead and let it go to /home/foo/.ssh/id_dsa. Do not enter a passphrase. If you provide a passphrase, then you'll have to interactively provide it each time you use the key.

Once you have done this, you will have two new files in foo@bar's .ssh folder - id_dsa and On baz, create a file in /home/foo/.ssh named 'authorized_keys', and make it readable and writeable only by foo. Copy the contents of the key made by foo@bar into this file. Be very careful about cut'n'paste here - will be a one line file but in most editors it will wrap over several lines, and cutting and pasting from an editor may insert extra line breaks that shouldn't be present.

Now foo@bar can make an ssh connection to foo@baz without providing a password. This includes scp and sftp.


Post Edited (24-11-05 08:17)

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 scp without password prompt   new
khaledhu 23-11-05 13:20 
 Re: scp without password prompt   new
halber_mensch 23-11-05 16:45 

 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Remember my login:
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum