Operating System - HP-UX
1832919 Members
2672 Online
110048 Solutions
New Discussion

Re: excute command on remote server

 
blu.karthi
Advisor

excute command on remote server

hi experts,
i want to run command on remote server...

requriment...

i having total 257 server....
i want to get host name of all server's
note : all server password are different

i requried idea for the script
4 REPLIES 4
Suraj K Sankari
Honored Contributor

Re: excute command on remote server

Hi,

First create a ssh password less environment then using a for loop you can run commands remotely.

Suraj
blu.karthi
Advisor

Re: excute command on remote server

is it any other way is there to do



or


is it possible to mentioned password on command itself
sen_ux
Valued Contributor

Re: excute command on remote server

There are different options. But you have to provide the passwd somehow.

1. Setup a password less ssh enviroment.Then you can create a script to check all the systems hostname.No passwd need to be provided.

2. If you are not setting up passwdless ssh,
still you can run the same script but it asks for the passwd for each time and you have to provide one by one, which is horrible for 257 servers.

3. You can create an expect script by providing each passwd.

Better and nice option is passwdless ssh.


blu.karthi
Advisor

Re: excute command on remote server

i type password one by one.... currently...
i am going to configure passwd less ssh