scp file to another server without asking for password


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting scp file to another server without asking for password
# 1  
Old 06-10-2009
scp file to another server without asking for password

hi

I tried reading some of the threads w.r.t scp/sftp file to another server in the same network without asking for password while copying files.....but couldnot succeed.

i have generated the public key for the system using "ssh-keygen -t " and kept it in the
.ssh/authorized_keys file.

even then it asked for password when i use scp

Any other way?
# 2  
Old 06-10-2009
There might be some spaces while you tried to copy the public key to authorized_keys file.
# 3  
Old 06-10-2009
hi

No additional spaces ...
some how its not working ...restarted the ssh as well
# 4  
Old 06-10-2009
make sure the authorized_keys file is 600

If you fix ssh connection without a password, the scp will work a well.
try this tutorial: http://www.ehow.com/how_4750765_rsync-over-ssh-password.html
and make sure your authorized_keys file has permissions of 600 when your done, or it wont work.

also - is the ssh server yours? sometime password less access is disabled in the sshd.conf.



Another good debugging option is to use "ssh -v into_the_server"

and you will see a lot of valuable info about the ssh process and where its failing.





Yonit
Linux Server Tips
# 5  
Old 06-10-2009
hi

i followed the steps as mentioned in the article. but still its not successful
am getting error as:

Quote:
unable to initialize mechanism library [/usr/lib/gss/gl/mech_krb5.so]
root@lessrv3's password:
# 6  
Old 06-10-2009
It looks like you are using kerberos for authentication. Is there a line like
Code:
GSSAPIAuthentication yes

in your sshd configuration file?
# 7  
Old 06-11-2009
no....

followed the instructions in the link
http://forums.sun.com/thread.jspa?th...4357&tstart=-5
and added the following in the sshd_config file...
changed the value of "PermitEmptyPasswords no "
to
"PermitEmptyPasswords yes"
and restarted the ssh

Code:
GSSAPIAuthentication=no
GSSAPIKeyExchange=no
StrictHostKeyChecking no
GSSAPIAuthentication=no
GSSAPIKeyExchange=no

now am getting the error as
Quote:
<root@lessrv3:/>ssh root@lessrv4
ssh: connect to host lessrv4 port 22: Connection refused
i have modified both the server files (sshd_config)
and both have public key of other servers in its authorized_keys2

Help me out!!!!

Last edited by aemunathan; 06-11-2009 at 04:34 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Need some help regarding file transfer between server (sftp/scp)

Hi All, Need some help regarding file transfer between server. Suppose we have system-A and system-B. To transfer file from system-A to system-B we usually share the public keys of system-A to system-B and do scp/sftp to transfer a file. Is it possible that public key of system-B can be... (3 Replies)
Discussion started by: abhi_123
3 Replies

2. Shell Programming and Scripting

I want to scp file from one server to another, both server have different user name and

i want to scp file from one server to another. both server have different user name and it needs to give password to transfer file.how can we mention password in the script itself so that we need not mention password while running the script. Say from servers cpli with user abc and file path /opt... (7 Replies)
Discussion started by: Moon1234
7 Replies

3. Shell Programming and Scripting

scp without password for destination server

I am using the below command to scp the file to destination server ($server). The ssh keys have been created between the source and destination servers. Still I am getting password authentication after executing the below scp command: scp $Local_dir/$file_pattern* $username@$server:/$ftp_dir/... (1 Reply)
Discussion started by: Ganesh L
1 Replies

4. Shell Programming and Scripting

How to scp File from root user in one server to say crt user in another server and avoid password?

Can someone help in writing some script through which I can transfer file (scp) from root user in abc server to crt user in hfg server and can give the crt user password in script itself so that it doesn't prompt me every time for password (4 Replies)
Discussion started by: Moon1234
4 Replies

5. UNIX for Dummies Questions & Answers

Use screen command in AIX to scp file to other server

Hello, Please assist me in using screen command in AIX to scp file to other server Best regards, Vishal (10 Replies)
Discussion started by: Vishal_dba
10 Replies

6. UNIX for Dummies Questions & Answers

scp to get a file from windows desktop to UNIX server

Hi, I want to use scp to upload file to my unix server. i am using this: scp D:\testr.txt unixuser@unixhost:/path it returns an error: ssh: D: host/servname not known i am not sure how to tell path of my D drive in the command and how will command understand it has to pick from my... (5 Replies)
Discussion started by: Kohli
5 Replies

7. Solaris

how scp a file to server with space in the directory name

Hello forum, I’m trying to get someone else’s log rotation & sync script working. The ksh script is sending daily compressed log files to a Windows RSA envision server. The name of the directory is “CA SITEMINDER_<IP address of the sending server>”. The servers we are sending from are a mix of... (3 Replies)
Discussion started by: TKD
3 Replies

8. Shell Programming and Scripting

Script to check for the newest file mutiple times a day and SCP it to another server.

Hi, I need a sample of a script that will check a specific directory multiple times throughout the day, and scp the newest file to another server. Example: current file is misc_file.txt_02272011 (the last part is the date), once that has been secure copied, another one may come in later the... (1 Reply)
Discussion started by: richasmi
1 Replies

9. UNIX for Advanced & Expert Users

Automated SCP script passing password to preserve source file timestamp

Hi My requirement is i want to copy files from remote server to the local server and also i need to preserve the timestamp of the remote file. By using scp -p , it is working fine in the interactive call but it is not preserving he file timestamp when i use it in the non interactive scp call... (1 Reply)
Discussion started by: skumar75
1 Replies

10. UNIX for Dummies Questions & Answers

File Missing When Grabbing Files from SFTP Server using SCP Command

Hi, I have this problem where sometimes my files would go missing when I schedule my crontab to run the SCP command to get file from the SFTP server. My crontab will run the scripts at an interval of 3 minutes (between the two scripts) The following is the setting in my crontab. ... (1 Reply)
Discussion started by: gingervitus
1 Replies
Login or Register to Ask a Question