0

So basicly I need to send a command from one server to another.

ssh [email protected] 'My command'

How do I specify the password?

2 Answers 2

2

If have two options:

2
  • Thanks. I'm doing it in php, so how can I make it type the password after? Jul 18, 2014 at 14:24
  • 2
    Well, in this case you can use @Samuel sshpass tool, but I strongly reccomend using SSH key authentication instead of writing your password in a PHP file, which is probably a bad idea.
    – unlink
    Jul 18, 2014 at 14:29
1

Use the sshpass utility.

sudo apt-get install sshpass

Then send commands via:

sshpass -p '<password>' <ssh/scp command>

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .