Hello,
What I want to do is to run a file on remote server by running a script at localhost but script should not ask ssh password of my remote server when script is executed.
Scenario1:
To copy files from server2 to data server:
$ scp -r root@server2_ip:/var/www/html/*.* /var/
When I enter above code, it asks for my server2 ssh password
Scenario2:
I want to run a script existing in server1 and it will be run at server2
Hello Gandolf989,
Thanks for your recommendation but it seems a bit intricate..
Btw, password is not localhost ssh password. It's remote server's ssh password
Hello,
After I enter those codes to local and remote servers, it asks again root password to establish an ssh connection. In server permit root login is prohibit. Could it be the reason?
If you are connecting as root to the remote server and the setting is PermitRootLogin=no then you will be unable to do this. If you are connecting as another user (non-zero uid) then this flag will have no effect, however you have to consider what happens with the standard profiles for that account logging in, e.g. does it assume a terminal, lock you into an application etc.