Results 1 to 3 of 3

Thread: Shell script sftp with user and password

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Exclamation Shell script sftp with user and password

    Hello, i need to do a shell script to transfer files from a SERVER1 to a SERVER2 and i need to know how can i do connect both servers using user and password. For this case i dont want to use a public keys, only user and password. This is posible? how??
    Tnx !!

  2. #2
    Senior Member
    Join Date
    Jul 2009
    Posts
    138
    Thanks
    67
    Thanked 4 Times in 3 Posts
    Rep Power
    6

    Default

    Try sshpass

    Code:
    export SSHPASS=login-password
    sshpass -e sftp -oBatchMode=no -b - user@192.168.1.5 << EOF
       cd folder
       put your-file.txt
       bye
    EOF

    http://www.cyberciti.biz/faq/noninteractive-shell-script-ssh-password-provider/
    English not my first language. If not understood my question ask me.

  3. #3
    Junior Member
    Join Date
    Nov 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Default

    Tanx its very easy.

    Quote Originally Posted by chinalinix View Post
    Try sshpass

    Code:
    export SSHPASS=login-password
    sshpass -e sftp -oBatchMode=no -b - user@192.168.1.5 << EOF
       cd folder
       put your-file.txt
       bye
    EOF

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Chroot user with no sftp
    By problemchild in forum Ubuntu / Debian
    Replies: 1
    Last Post: 13th November 2009, 11:40 AM
  2. Howto automate ssh scp sftp Password Connection
    By chinalinix in forum Networking, Firewalls and Security
    Replies: 1
    Last Post: 15th August 2009, 01:16 AM
  3. Solaris Change User Password Using a Shell Script
    By vikas027 in forum Solaris/OpenSolaris
    Replies: 1
    Last Post: 14th June 2008, 12:06 AM
  4. Linux UNIX SFTP in a Shell Script
    By Nishanthhampali in forum Shell scripting
    Replies: 1
    Last Post: 30th January 2008, 02:16 PM
  5. Replies: 0
    Last Post: 20th December 2006, 03:36 PM

Tags for this Thread

Posting Permissions

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