Hi .
I have a problem, please see if anyone can help me out:
I have 2 servers which I have connected through an ssh without password (with public keys permissions, etc). The user input both on the client and on the server is john.
That is, I do:
ssh john @ server uname -a for example (and I have managed to work without password) (on the server there is also the user john as I said)
But now I need to do
The normal operation in the server is to do (entering with user john) then sudo su - userserver2 and then execute a script with sudo (since it is root) with sudo /etc/init.d/scritp1
What I want is to be able to execute the script from the remote client
but ssh john @ server "sudo su - userserver2" for example, it does not work, it gives me permission denied.
How could I do it please?
Thanks in advance.
I have a problem, please see if anyone can help me out:
I have 2 servers which I have connected through an ssh without password (with public keys permissions, etc). The user input both on the client and on the server is john.
That is, I do:
ssh john @ server uname -a for example (and I have managed to work without password) (on the server there is also the user john as I said)
But now I need to do
The normal operation in the server is to do (entering with user john) then sudo su - userserver2 and then execute a script with sudo (since it is root) with sudo /etc/init.d/scritp1
What I want is to be able to execute the script from the remote client
but ssh john @ server "sudo su - userserver2" for example, it does not work, it gives me permission denied.
How could I do it please?
Thanks in advance.