SSH with Password in Shell script


Results 1 to 6 of 6

Thread: SSH with Password in Shell script

  1. #1
    Join Date
    Nov 2012
    Posts
    8

    Smile SSH with Password in Shell script

    Hai,

    Can anyone suggest me how to provide the ssh password with in the shell script to connect to another server.


    Thanks in Advance

  2. #2
    Join Date
    Oct 2000
    Location
    Sweden
    Posts
    494
    Well, it has been asked quite a few times... Thing is, you can't - not in a "normal" way.
    Maybe you can write something in C++ or whatever programming language you master.

    Wat you normally do when you need to login without any user action is use ssh keys. I found one instruction here: http://www.linuxproblem.org/art_9.html
    (I haven't validated it but it looks correct.)
    Last edited by x; 11-30-2012 at 01:00 PM.
    In pingvino veritas!

  3. #3
    Join Date
    Nov 2012
    Posts
    8

    Smile

    Hi,

    Thanks for your response.


    I have seen the provided link.

    I just need to provide the password for the ssh remote log in only from the shell script but I don't want to configure the ssh without password.

    Please help me in this regards


    Thanks

  4. #4
    Join Date
    Nov 2012
    Posts
    8
    I have seen about the sshpass utility....Will it work for the Redhat linux 5.4 version

  5. #5
    Join Date
    Dec 2012
    Posts
    1
    You can use the expect tool.

    Some examples are shown at: http://stackoverflow.com/questions/4...to-ssh-command

  6. #6
    Join Date
    Dec 2012
    Posts
    1
    You can use the expect tool.

Posting Permissions

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