Re: passing password to ssh on command line

From: Hrvoje Spoljar (fcbyr_at_k.cos.ue)
Date: 02/03/05

  • Next message: Richard E. Silverman: "Re: Two sshd newbie questions"
    Date: Thu, 3 Feb 2005 02:02:01 +0000 (UTC)
    
    

    Michael McGarry <replytogroup@nospam.org> na grupi comp.security.ssh pise:
    > Hi,
    >
    > Is there a way to give the password to ssh as a command line argument?

    check out expect, you can script things like

    #!/usr/bin/expect -f
    spawn ssh user@somehost
    expect "Password
    send "$argv\r"

    call it like ./script password and c what happens ;-)

    -- 
     ____ __  ___| |  ___   Ignorance is    .~.    hrvoje.spoljar@><.pbf.hr
    (_-< '_ \/ _ \ |_/ -_)  bliss, but     / V \   irc # RoCkY 
    /__/ .__/\___/__/\___|  knowledge is  /(   )\  icq : 53000945   
       |_|                  power!          ^-^    
    

  • Next message: Richard E. Silverman: "Re: Two sshd newbie questions"

    Relevant Pages

    • Re: Really need help on this one
      ... Is there a way to read the output of a particular command into ... Heres a better example using ssh. ... set timeout $timeout ... exec kill -9 $pid ...
      (comp.lang.tcl)
    • Re: OT: Hard disk mirror with Paragon on USB stick?
      ... at least two pages of intricate command line stuff. ... The password is only used when you want to backup to a remote machine ... via the network, using the ssh protocol. ... (e.g. with linux, ...
      (sci.electronics.design)
    • RE: midnight commander and ssh sftp
      ... midnight commander and ssh sftp ... which is displayed at the bottom of the MC panel. ... "Left file command options right" at the top of the MC ... MC SSH session with the remote host by hitting F10 key. ...
      (freebsd-questions)
    • Re: sshd and ftpd
      ... ssh keys, so when you log in it doesn't ask for one. ... we want to be able to connect to our remote host without ... If you used the defaults supplied by the ssh-keygen command, ...
      (Ubuntu)
    • Re: [Info-ingres] problems with ssh
      ... Check the SSHD log on the server for errors. ... ancient version of SSH, unfortunately. ... the command seems to have functioned - but just wont terminate and leaves a process hanging around. ... Duckman: You got anymore of those glues? ...
      (comp.databases.ingres)