Results 1 to 4 of 4

Thread: ftp/scp username/password via script

  1. #1
    Senior Member
    Join Date
    Apr 2002
    Posts
    417

    ftp/scp username/password via script

    Hi,

    I was wanting to ftp or scp a file from a windows or linux bux over to a linux box via scp or ftp (pref scp) however when connecting, it will obviously ask for a password. how can I do all this at once? -B option for scp won't work.
    I heard of a way to cache the certificate in ssh so it doesn't require a password or something like that?. Does anyone know a link that shows how to do this. The two machines will be on a local LAN and not passing out of our network.

    thanx,

  2. #2
    Moderator
    Advisor
    redhead's Avatar
    Join Date
    Jun 2001
    Location
    Copenhagen, Denmark
    Posts
    811

    Re:ftp/scp username/password via script

    If it's between two linux boxes, then do:
    Code:
     source.server $ > ssh-keygen -t rsa   
      (Dont put in any password when asked)
     source.server $ > ssh-keygen -t dsa
      (Dont put in any password when asked)
     source.server $ > scp .ssh/id_[rd]sa.pub target.server:
     source.server $ > ssh target.server.com
     target.server $ > cat id_dsa.pub >> .ssh/authorized_keys2
     target.server $ > cat id_rsa.pub >> .ssh/authorized_keys
    And you dont need any password when connecting from source.server to target.server.
    Altho I have no idear if this will work with windows<->linux situations.

  3. #3
    Moderator
    Good Guru
    Schotty's Avatar
    Join Date
    Jul 2001
    Location
    Milwaukee, WI
    Posts
    5,758

    Re:ftp/scp username/password via script

    [quote author=Blaqb0x link=board=9;threadid=4471;start=0#44683 date=1028619665]
    Hi,
    I was wanting to ftp or scp a file from a windows or linux bux over to a linux box via scp or ftp (pref scp) however when connecting, it will obviously ask for a password. how can I do all this at once? -B option for scp won't work.thanx,
    [/quote]

    ncftp has options for specifying usernames and passwords. Have you tried that?

  4. #4

    Re:ftp/scp username/password via script

    ncftp can take a password from its command line

Similar Threads

  1. SSH and bash script
    By vwgtiturbo in forum Programming
    Replies: 7
    Last Post: 12-25-2008, 04:40 AM
  2. Firewall script in RHEL 4
    By sud.tech in forum Programming
    Replies: 8
    Last Post: 06-12-2008, 01:07 PM
  3. Rsync incremental backup script
    By vwgtiturbo in forum Programming
    Replies: 6
    Last Post: 06-07-2006, 08:19 PM
  4. Probs in a script called from another script
    By Outlaw in forum Programming
    Replies: 1
    Last Post: 03-12-2004, 01:54 PM
  5. Shell Script to modify apachectl
    By gaxprels in forum Programming
    Replies: 6
    Last Post: 07-23-2002, 07:18 PM

Bookmarks

Posting Permissions

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