The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 09-01-2008
goutham4u goutham4u is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 4
Change user on remote machine and execute script!

Hi,

I need to login into remote server and execute a shell script over there.

As of now i am making use of ssh command

ssh primUser@135.254.242.2 sh /poll.sh

I am logging in as primUser but unless i change the user to root the script execution on the remote machine is not possible.

Is there a way wherein i can make use of perl script or anything like that and remotely change the user to root?

ssh primUser@135.254.242.2 su -

The above command is giving me a 'su - Sorry' message.

Can anybody help me to change the login to root on remote machine and execute the script poll.sh on it?