Find the answer to your Linux question:
Results 1 to 3 of 3
I am running ssh user@hostname [command] from CGI script but as I am not providing the password its not running. How can I provide password at runtime or is there ...
  1. #1
    Linux Newbie
    Join Date
    Jan 2008
    Posts
    114

    Want to run ssh user@hostname [command] from CGI Script

    I am running
    ssh user@hostname [command]
    from CGI script but as I am not providing the password its not running.

    How can I provide password at runtime or is there any way to hardcode it in CGI script?

  2. #2
    Linux User
    Join Date
    Jun 2007
    Posts
    318
    You could use public/private keys. Refer to the manpage for ssh-keygen for details.

    Code:
    # man ssh-keygen
    Then look at the -i option for ssh in ssh's manpage on how to use those keys in the ssh command.

    Vic

  3. #3
    Trusted Penguin Cabhan's Avatar
    Join Date
    Jan 2005
    Location
    Seattle, WA, USA
    Posts
    3,230
    Indeed. Taking it one step further, you can set up your system as described in:

    setting up no-password ssh

    I have one of my systems set up this way, and it makes life easier.
    DISTRO=Arch
    Registered Linux User #388732

Posting Permissions

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