rsync - storing password in script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting rsync - storing password in script
# 1  
Old 12-08-2009
rsync - storing password in script

Hello,

I wish to store the password in an rsync script so that when prompted it just enters the password.

I know I can set up passwordless logins, but I have never been able to do this on this particular server so I am resorting to storing the password in the script:

Code:
rsync -avz -e ssh root@XXX:/var/xxx /var/

So when the above normally prompts for a password I want it to automatically enter it is.

I have tried piping it but it doesnt work.

I have also played around with "expect" but I couldnt get "spawn" to work.

any help is greatly appriceated.
# 2  
Old 12-08-2009
have you tried using password-file?
# 3  
Old 12-10-2009
Hi If i use the below syntax it still prompts:

rsync -avx <hostname>:/XX /ZZZ --password-file /utils/passwd.txt
# 4  
Old 12-10-2009
Just a suggestion...

Since you are using rsync over ssh, instead of using a password, maybe you should consider setting up public private keys for authentication
# 5  
Old 12-11-2009
I could never get them to work on these two servers, and as they are on an internal network I am not bothered about security at this time.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Emergency UNIX and Linux Support

How to provide password for rsync in shell script?

Hi, i want to call the rsync in a shell script so that i can run it in background by passing the password within script itself. Can any one please let me know how can i provide the password in the shell script itself so that rsync will read the password when promted by the script. Its very... (11 Replies)
Discussion started by: Little
11 Replies

2. Shell Programming and Scripting

Storing filenames in an array in shell script

hi, i am writing a shell script in which i read a line in a variable. FNAME="s1.txt s2.txt s3.txt s4.txt s5.txt" i want to create a array and store single file names in a array.. so the array should contain arr="s1.txt" arr="s2.txt" arr="s3.txt" arr="s4.txt" arr="s5.txt" how to... (3 Replies)
Discussion started by: Little
3 Replies

3. Shell Programming and Scripting

Perl script for taking inputs from one script and storing them into a document.

Hi. I wanted to create a Perl script which can take the outputs of a Perl script as it's input and temporarily store them in a document. Need help. Thanks.:) (8 Replies)
Discussion started by: xtatic
8 Replies

4. Homework & Coursework Questions

linux service script for storing uptime

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Can you please advise a script for the following: write linux service named system_up_duration .This service... (6 Replies)
Discussion started by: fed.linuxgossip
6 Replies

5. Shell Programming and Scripting

linux service script for storing uptime

Hi, Can you please advise a script for the following: write linux service named system_up_duration .This service will create one file named uptime in directory ‘/temp/'. In this file the service will store the total time for which the system is up and running .The file will be updated after... (1 Reply)
Discussion started by: fed.linuxgossip
1 Replies

6. Shell Programming and Scripting

Storing a password

Hello, for an automated telnet login script I need to store a password on the server. Is there a possibility to store the password in an encrypted form and decrypt it every time the login is performed? Are there any ideas Love, Sally (5 Replies)
Discussion started by: Sally[-_-]
5 Replies

7. OS X (Apple)

get around rsync password prompt

Hey there, I'm trying to do a very simple rsync to back up my computer to an external drive connected via usb every night, but it keeps asking for a password. I tried using the password file flag, but it looks like that is only a daemon. Does anyone have any ideas? This has eaten up a lot of my... (4 Replies)
Discussion started by: aarond
4 Replies

8. AIX

PROBLEM: RSYNC and no user password "secrets"

OK, I am stuck and could use some help here. I have a RSYNC script that I wrote to where I would like to have the users password "never" initiated. I been trying to get the /etc/rsyncd.secrets file to work, but keep getting error messages. But I think it has to do with the way my script is... (2 Replies)
Discussion started by: tfort73
2 Replies

9. Shell Programming and Scripting

rsync without password prompt

Hi, I am tranfering the files from local machine to remote machine using rsync utility but it is prompting password. but i don't want to provide through prompt. how can i give in my shell script. can anyone suggest me.Thanks in advance rsync -rvcpogtl -e "ssh $LOCAL_PORT" $SOURCE_DIR... (1 Reply)
Discussion started by: KiranKumarKarre
1 Replies

10. UNIX for Advanced & Expert Users

calling rsync without promting to input password

Hi , I am trying to call rsync from a perl script. I do not want to get promted for each file transfer. Is there is any way i can avoid prompting for password? I tried to store it in file and use rsync --password-file option. Command : $rsync --password-file=pass.txt -crgpto -e /usr/bin/ssh2 -v... (1 Reply)
Discussion started by: mandira
1 Replies
Login or Register to Ask a Question