LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-06-2005, 03:29 PM   #1
jedimastermopar
Member
 
Registered: Jun 2004
Distribution: fedora core 1 and core 2
Posts: 178

Rep: Reputation: 30
rsynch with the --password-file????


I am trying to run the following script.

#!/bin/bash
rsync --recursive /home/* root@XXX.XXX.XXX.XXX:/home/backup --password-file=/etc/rsyncpass

and the /etc/rsyncpass file is 640 perms and has the correct password as per both the secrets file and the account on both machines.

Now when I run the script it prompts me for the password. I have to type it in if I type it in exactly as it is in the /etc/rsyncpass file it work and everything goes about as normal.
I must be doing something wrong. But I really want this script to work so I don't have to type in a password.
 
Old 05-06-2005, 04:54 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Did you actually read the description of this option in the man page as in how it describes that this option is only available if your accessing or attempting to rsync to a rsync server?

Code:
This option allows you to provide  a  password  in  a  file  for
accessing  a  remote rsync server. Note that this option is only
useful when accessing a rsync server using the built  in  trans-
port,  not  when using a remote shell as the transport. The file
must not be world readable. It should contain just the  password
as a single line.
 
Old 05-07-2005, 08:14 AM   #3
jedimastermopar
Member
 
Registered: Jun 2004
Distribution: fedora core 1 and core 2
Posts: 178

Original Poster
Rep: Reputation: 30
Yes I did read that and I am trying to rsync to an rsynch server.

BackupServer1 - Has rsynch installed on it

FileServer1 - Also has rsync installed on it and back up the home directory to Backupserver1:///home/backup

If I run the same line below minus with or without the --password-file=/etc/rsyncpass I get prompted for the password. If I type in the password the backup goes perfectly. I want to run this in a script so I can put it in cron. Just to make sure I am on the right track here.
1) The script needs to be run from the Fileserver1 machine?

2) What should the permisions and syntax be on the /etc/rsynpass file? currently 640 and has a single line with the password typed in on the first line.

3) I am not entirely sure what this means but I would imagin if I spefically don't tell it to use something else like ssh or ftp it would use the built in transport?
"Note that this option is only useful when accessing a rsync server using the built in transport, not when using a remote shell as the transport"
Maybe I am missing something there.

4)My /etc/rsyncd.conf files on both the backupserver1 and the filserver1 are both identical and both list both machine IP's as hosts and point to a secrets file that have the correct user name and password in a file with a single line usernameassword

Still stuck, I mean its not too complicated what I want to accomplish, run an rsync cron to copy the contents of /home from one machine to another every hour. when I run the script do I need to specify anything on the command line or will it work with a simple ./rsynscript.sh
It does run but like I said it prompts for a password.
 
Old 05-07-2005, 09:50 AM   #4
jedimastermopar
Member
 
Registered: Jun 2004
Distribution: fedora core 1 and core 2
Posts: 178

Original Poster
Rep: Reputation: 30
Ok I think I am starting to figure it out a bit now.
the : means to connecti via ssh
and :: means that I should connect via the daemon
and the --password-file command will only work if you are connecting via daemon mode?
I think I get it now. How can I tell if the daemon mode is running on the backup server? And this is supposed to work via a push scrip from the fileserver to the backservr and not a pull from the backserver to the fileserver right?

I found another page that describes copying the ssh cert key from one machine to the other and calling that key in the rsync to automate an ssh connection. That seems a bit dangerous to me leaving a copy of the key on the machine, although storing the password in plain text isn't all that great of an idea either.

Sorry for the spoon feeding, but I have never used rsync before and I am just tryin to figure it out.
 
Old 05-07-2005, 11:23 AM   #5
jedimastermopar
Member
 
Registered: Jun 2004
Distribution: fedora core 1 and core 2
Posts: 178

Original Poster
Rep: Reputation: 30
ok I made some progress.
I have it all running now with the :: but I think I am doing something wrong still.
if I run

rsync -avvzo --recursive --password-file=/tmp/rsync.password root@xxx.xxx.xxx.xxx::backupshares /home/backup

and the /tmp/rsync.password
contains a single line with the root password should it not be able to copy any file on the xxx.xxx.xxx.xxx system? I am not able to go into directories with 770 and not bale to copy files that are also 770 I can copy other files and directories ok. maybe I am missing something still.
 
Old 05-07-2005, 01:25 PM   #6
jedimastermopar
Member
 
Registered: Jun 2004
Distribution: fedora core 1 and core 2
Posts: 178

Original Poster
Rep: Reputation: 30
Ahh I found my problem. In the rsyncd.conf file I put the uid and gid variables in the wrong place. All is well. Thanks for listening.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
password file roAder Slackware 2 02-28-2005 06:08 PM
Samba Password File gauge73 Linux - Networking 2 01-28-2003 09:16 PM
Password file radskatehell Linux - General 5 01-21-2003 05:17 PM
password file juno Linux - General 13 10-04-2002 09:27 AM
Password on zip file FNC Linux - Security 4 04-19-2002 11:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration