The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
execute a command silently or quietly within a shell lumix Shell Programming and Scripting 4 12-15-2007 12:10 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 03-27-2006
Registered User
 

Join Date: Feb 2006
Posts: 47
become SU - ...Silently

Hi,

One more question guys....

I need to become "su " during a script and then execute a script and then exit back and become the normal user.

How can this be done ?
Reply With Quote
Forum Sponsor
  #2  
Old 03-27-2006
Klashxx's Avatar
HP-UX/Linux/Oracle
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 383
Code:
remsh host [-l username] [-n] command
Reply With Quote
  #3  
Old 03-27-2006
Registered User
 

Join Date: Feb 2006
Posts: 47
It says " Permission denied "

Do i need to set some environment for this ?

Thanks
Reply With Quote
  #4  
Old 03-27-2006
Registered User
 

Join Date: Feb 2006
Posts: 47
This is what i did :

remsh localhost[-l root] [-n] <some command>

and i got permission denied.
Reply With Quote
  #5  
Old 03-27-2006
Klashxx's Avatar
HP-UX/Linux/Oracle
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 383
Yes , u have to touch /etc/hosts as root

See de man pages of remsh and rlogin for more..

Cheers
Reply With Quote
  #6  
Old 03-27-2006
Registered User
 

Join Date: Feb 2006
Posts: 47
what will "touch /etc/hosts" as root do ?

Pardon my ignorance please, but i really did not get that part.

Dont I have to provide the root password some where in this command ?

remsh localhost[-l root] [-n] <some command>

And since i need to su to my localmachine, is the localhost mentioned in the command appropriate ?


Thanks
Reply With Quote
  #7  
Old 03-27-2006
Klashxx's Avatar
HP-UX/Linux/Oracle
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 383
Sorry , i was trying to explain that you have to modify the /etc/hosts (don“t touch it) for authentication as root using remsh ...
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0