ssh - scripts - password prompt
Hello
I have successfully configured ssh, I can login to my remote Linux server without being prompted for a password, however when I try an add this into a script I get prompted for a password... What Im trying to do is is to login remotely using ssh then run a command using the root user: From my Linux server I run sudo -u my_ssh_account ssh my_ssh_account@my-remote-server.com sudo - root /tmp/mycommand This works, but when I put it into a script it prompts me to enter the ssh accounts password...and Im puzzled Any thoughts suggestions would be apreciated . D |
Quote:
Can you paste your script |
Hello its very basic script
#!/bin/bash echo "My test command is running" sudo -u test1 ssh test1@myserver.com sudo -u root -s /tmp/mytestscript.sh exit Im just wondering do you have to put sudo su and not sudo -u |
Quote:
ssh test1@myserver.com /tmp/myestscript.sh |
All times are GMT -5. The time now is 12:08 AM. |