LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 08-01-2004, 04:18 PM   #1
kmoffat
Member
 
Registered: Jul 2003
Location: near Seattle
Distribution: Debian/Ubuntu/Suse
Posts: 240
Blog Entries: 2

Rep: Reputation: 30
rsync password-file not working


I'm trying to rsync my slack10 partition to a debian server using the following script:

#!/bin/sh
mount /mnt/hda11
rsync -auvz --delete --password-file=/root/SlackPasswd --exclude=/mnt/* --exclude=/proc/* root@compaq:/ /mnt/hda11
umount /mnt/hda11

This is a home lan, and the script is run on the debian box. This always asks me for the password. SlackPasswd contains the root password, and is in the /root directory, readable by root. I'd like to put a script in a cron job to do this weekly, but need the password to work.

I've also tried adding "export RSYNC_PASSWORD=" to the script, to no avail; same results.

Anyone do this sort of thing? I've never tried rsync, but the rsync line works outside the script when I enter the password.

rsync -auvz --delete --exclude=/mnt/* --exclude=/proc/* root@compaq:/ /mnt/hda11

compaq is the slack box.

thanks...
 
Old 08-01-2004, 08:30 PM   #2
osvaldomarques
Member
 
Registered: Jul 2004
Location: Rio de Janeiro - Brazil
Distribution: Conectiva 10 - Conectiva 8 - Slackware 9 - starting with LFS
Posts: 519

Rep: Reputation: 34
Hi kmoffat,
I was reading the rsync manual and found this text.
Quote:
--password-file
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 transport, 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.
Your syntax suggests no use of rsync server and if you run it as root you may not need to specify the password. Of course it will depend on the setting of rsh/ssh between your machines. Please, tell us what remote shell you are using into your home lan.
 
Old 08-01-2004, 11:18 PM   #3
kmoffat
Member
 
Registered: Jul 2003
Location: near Seattle
Distribution: Debian/Ubuntu/Suse
Posts: 240
Blog Entries: 2

Original Poster
Rep: Reputation: 30
I assume it's the built in protocol, since I didn't specify. I also tried adding -e ssh with no change. I have tried scripts on both the client and the server; same result, always asks for password. I tried running on the server "rsync --daemon" but had a connection protocol failure error. I guess I'll go back to the drawing board and google some more. Must be a basic setup procedure I'm missing.

Odd that rsync works from the command line where I can enter the password, but not from a script. Might be the rsyncd.conf file that I'm messing up. More tomorrow.
 
Old 08-02-2004, 01:29 AM   #4
osvaldomarques
Member
 
Registered: Jul 2004
Location: Rio de Janeiro - Brazil
Distribution: Conectiva 10 - Conectiva 8 - Slackware 9 - starting with LFS
Posts: 519

Rep: Reputation: 34
Hi,
Probably the password is being asked by rsh or ssh on the remote machine. By remote machine I want to say the machine you are not sat on. An easy test is enter
Code:
rsh <remote-machine> echo
or
ssh <remote-machine> echo
In both cases, if the immediate answer is a white line, you're ok to run rsync. If it asks for password and shows the white line or displays a message "connection refused" or "permission denied", you have to setup your machines to accept remote commands from the other to work properly. Make these tests and tell me the results.
rsync normally works without any configuration file for general purposes like as you are trying.
The purpose of an rsync server is to work as an ftp server as you can see in www.kernel.org. It is very specific to send always the same set of files. The general purpose serves as a replacement for "rcp" or even "cp" when you are working on the same system.
 
Old 08-02-2004, 06:07 AM   #5
kmoffat
Member
 
Registered: Jul 2003
Location: near Seattle
Distribution: Debian/Ubuntu/Suse
Posts: 240
Blog Entries: 2

Original Poster
Rep: Reputation: 30
rsh noisy echo
results in nothing, just a flashing cursor on the next line
ssh noisy echo
asks for password, then gives permissiion denied error.
 
Old 08-02-2004, 06:23 AM   #6
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
You have to copy your ssh public key on Debian like :

On slackware :
ssh-keygen -t rsa
-- type enter (default) after each question even for password, press enter
-- it will generate 2 files : the private key and the public key (id_rsa.pub is your public key)
Then copy the public key to debian :
scp ~/.ssh/id_rsa.pub noisy:.ssh/authorized_keys2

now try ssh noisy
 
Old 08-02-2004, 10:41 PM   #7
kmoffat
Member
 
Registered: Jul 2003
Location: near Seattle
Distribution: Debian/Ubuntu/Suse
Posts: 240
Blog Entries: 2

Original Poster
Rep: Reputation: 30
That is TOO easy, many thanks. I've been beating my head against the proverbial wall for a couple of days trying to figure this out. Seems I had a big gap in my knowledge.

Thanks again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
rsync Does Not Preserver File Ownership VorlonInfoTech Linux - General 4 10-20-2005 11:19 AM
Can rsync read passwords from a file ? vmniza Linux - Networking 1 06-10-2005 01:25 AM
rsync & scponlyc shell: not working hamish Linux - Software 3 05-28-2005 07:15 AM
How to have rsync skipp certain file typs phatboyz Linux - Networking 1 10-15-2004 02:23 PM
rsync: where the heck is the .conf file? vrillusions Linux - Newbie 5 02-22-2003 05:47 PM


All times are GMT -5. The time now is 10:11 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration