1830900 Members
3359 Online
110017 Solutions
New Discussion

Re: RSH scripting

 
SAM_24
Frequent Advisor

RSH scripting

Hi,

I want to execute script on remote system as a particular user

remsh system su - user -c script

Remote script is being executed without argument.

Any help is appreciated.

Thanks.
Never quit
3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: RSH scripting

remesh system /usr/bin/su -c "scriptname "

The scriptname and argument in the su -c must be in double quotes.

You should also make sure the full path is in the scriptname, because you have no path in this setup.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Denver Osborn
Honored Contributor

Re: RSH scripting

How about...

remsh hostname -l username -n script args

If you don't have the .rhosts or host.equiv file setup then try rexec.

rexec hostname -l username -n script args

hop this helps,
-denver
Donny Jekels
Respected Contributor

Re: RSH scripting

if the script requires root privileges, then you could use sudo.

remsh remote_host "/usr/local/bin/sudo scritp_to_exec"

of course you know you will have to add the script perms in /etc/sudoers file.
"Vision, is the art of seeing the invisible"