ssh in shell script, then execute commands after password -


i'm trying write simple shell script execute commands on server box via ssh.

i'm not trying pass password within shell script, i'm wondering how can run commands on box after password entered.

so far, when execute script, nothing happens after enter password. or, executes when kill ssh process.

i'm sure it's easy, i've been searching hours , nothing has come on net, because nobody else needs ask that.

is there way natively within shell? thanks!

look if want ssh without prompting password need key authentication rather password authentication. else try;

sudo apt-get install sshpass sshpass -p your_password ssh user@hostname 

and execute command @ remote;

ssh user@host 'command' 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -