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
Post a Comment