Hi ,
I have three linux servers. I want to login from one server and check some status in the other server.
How to connect other server from one server using shell script.
Can anyone advice on this?
Thanks,
Chelladurai.
Hi ,
I have three linux servers. I want to login from one server and check some status in the other server.
How to connect other server from one server using shell script.
Can anyone advice on this?
Thanks,
Chelladurai.
cd
mkdir .ssh && chmod 700 .ssh
ssh-keygen
Leave all in defaults (hit enter, enter, enter...), don't enter any passphrase.
2. Copy file id_rsa.pub to remote server (repeat for all servers You want to use).
scp ~/.ssh/id_rsa.pub user@remote.host
ssh user@remote.host
mkdir .ssh && chmod 700 .ssh #ignore errors if occure here
cat id_rsa.pub >> ~/.ssh/authorized_keys
chmod 644 ~/.ssh/authorized_keys
ssh user@remote.host
In script use:
ssh user@remote.host "uptime"
This will execute "uptime" on remote host and return all STDOUT to local console.
Hi All,
I need to single script to connect the server and check one particular script is running or not. I want in shell script maode.
If i run the script, it will connect two or three servers and get back with the status of the server's script.
Thanks in advance
What did you try so far, where are you stuck? This is a support forum, not a freelancer/project forum.