Consider two servers tst01 and tst02.
i need to log in tst01 and check for the processes which run in tst02.
then based on pid , i need to kill that process.
is it possible to achieve?
I am able to connect to tst02 using ftp.
But the problem is, if i use ps it says invalid command.
How i can overcome this and start and stop processes which are in different servers?
thanks
This can be done using ssh command ..
$ ssh user@tst02 "kill -9 process_id"
Guide : SSH Tutorial for Linux - Support Documentation
yes!.
But each time i am doing ssh, it asks for password.
for example, if i execute,
ssh usr@tst02 "ps -ef"
this asks for usr@tst02 's password:
After entering password, it's listing the processes.
One more thing, i am not able to execute scripts using ssh.
I have tried:
ssh usr@tst02 "./usr/path/scr/scrname.sh"
It says ./usr/path/scr/scrname.sh not found.
Is it possible to automate in the script without entering password?
Thanks
for password less login using ssh pls check this link.
ssh-keygen: password-less SSH login
Also pls correct the syntax
ssh usr@tst02 "./usr/path/scr/scrname.sh"
correct one
ssh usr@tst02 "/usr/path/scr/scrname.sh"
. means you are searching from currect directory