Find the answer to your Linux question:
Results 1 to 5 of 5
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    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
    cd mydir
    get myfile

    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.



  2. #2
    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 : -

    open -u username,password FTP_Site
    cd mydir
    get myfile
    Save the above commands into a file, say ftp_script. To run the script just run the command : -

    $ lftp -f ftp_script
    With Regards,

  3. #3
    Linux Guru anomie's Avatar
    Join Date
    Mar 2005
    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:

    It's written for suse, but is sufficiently generic (with the exception of step 7: restarting the sshd service).

  4. $spacer_open
  5. #4
    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


  6. #5

    Thumbs up 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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts