Results 1 to 5 of 5
hey all,
I am trying to automate an SFTP jop using bash scripting. thing is i can't figure out how to set up sftp to allow me to log in ...
- 12-15-2006 #1Just Joined!
- Join Date
- May 2006
- Posts
- 39
automated SFTP in FD5
hey all,
I am trying to automate an SFTP jop using bash scripting. thing is i can't figure out how to set up sftp to allow me to log in without a password. i need to log in with a password but there is no sftp option that would allow me to do this. i must enter the password manually. how do i set up such a system? this is what i want to do :
sftp user@machine
password
cd mydir
get myfile
quit
i need to negate the password part of figure out how to put it in the first line i read that i can use the -b option but i am not at all clear as to how this would work. any suggestions would be greatfull....i am new to linux o please be easy on me.
thanks
-B
- 12-20-2006 #2Linux User
- Join Date
- Jun 2006
- Posts
- 311
Hi ikiini,
You can automate ftp process by using the sophisticated file transfer program, lftp. By using the -u option with open command you can enter the username and the password also in the script to run without getting prompted for password. But remember that you are going to store this password in a file. So your script would look like this : -
Save the above commands into a file, say ftp_script. To run the script just run the command : -open -u username,password FTP_Site
cd mydir
get myfile
bye
With Regards,$ lftp -f ftp_script
Thinker
- 12-20-2006 #3
If you're not running a ftp server on the other end (and want to stick with ssh/sftp) you have a couple options:
1. You can use scp coupled with pubkey authentication.
2. You can use sftp with the -b option, again coupled with pubkey authentication.
Here is a pubkey authentication howto if you're interested: http://wiki.suselinuxsupport.de/wikk...Authentication
It's written for suse, but is sufficiently generic (with the exception of step 7: restarting the sshd service).
- 12-21-2006 #4Just Joined!
- Join Date
- May 2006
- Posts
- 39
thank you for the input...i am goign to try both approaches on friday when i get into work. However, My boss wants me to do the automation with Kettle's chef tool. if you guys are familar with this tool any suggestions on how to do this would be great. Thanks
-B
- 12-27-2006 #5Just Joined!
- Join Date
- Dec 2006
- Posts
- 13
Thanks
Hey, thanks man. I've been working on a script for several weeks to automate syncing between my machine and an ftp server, and your reply(thinker) demystified a huge problem I was having =D


Reply With Quote