Results 1 to 5 of 5
Hi guys, this is my script, I am trying to rsync to a school folder located at the school server and I am trying to bypass the password field and ...
- 01-26-2010 #1Just Joined!
- Join Date
- Jan 2010
- Posts
- 3
Bash script : Rsync + expect password not work
Hi guys, this is my script, I am trying to rsync to a school folder located at the school server and I am trying to bypass the password field and already facing insanely amount of difficult. I have researched across the forums and tried different method but couldn't get any of them to work.. Will anyone provide me with any guide lines? thanks!
I cant post URL because i don't have 15 posts or more, but let's assume that rsync "testfile" "destination:folder" works because I have try it on the command line.#!/bin/sh
/usr/bin/expect <<EOD
rsync "testfile" "destination:folder"
expect "password:"
send "password\r\n"
interact
EOD
thanks
- 01-26-2010 #2Just Joined!
- Join Date
- Jan 2010
- Posts
- 3
Anyone help?
- 01-26-2010 #3Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
I can't be of help concerning the expect utility that I just discovered.
I would suggest using RSA public key authentication mechanism of SSH. You won't be able to store a password in a file (I guess that's what you are trying to do). You'll have to store your private key locally using ssh-add, providing your password once only. Your public key must have been referenced by the remote SSH server. Then you can rsync transparently.
I hope it's of help !
- 01-31-2010 #4
Does your school's server have an rsync daemon running? Or do you have SSH access? Either way will work, but you must have one or the other if you have succeeded.
If the server is running a daemon, try the --password-file option. That is, put the password in a file and pass it to rsync, something like this:
Code:rsync --password-file=$HOME/password.txt testfile user@server::folder/
- 01-31-2010 #5Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
I expressed myself very badly, my apologies.I would suggest using RSA public key authentication mechanism of SSH. You won't be able to store a password in a file (I guess that's what you are trying to do). You'll have to store your private key locally using ssh-add, providing your password once only. Your public key must have been referenced by the remote SSH server. Then you can rsync transparently
Please read as follows :
I would suggest using RSA public key authentication mechanism of SSH. You won't need to store a password in a file (I guess that's what you are trying to do). You'll have to load your private key locally using ssh-add, providing your password once only. Your public key must have been referenced by the remote SSH server. Then you can rsync transparently
0 + 1 = 1 != 2 <> 3 != 4 ...
Until the camel can pass though the eye of the needle.


Reply With Quote