become SU - ...Silently


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting become SU - ...Silently
# 1  
Old 03-27-2006
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 ?
# 2  
Old 03-27-2006
Code:
remsh host [-l username] [-n] command

# 3  
Old 03-27-2006
It says " Permission denied "

Do i need to set some environment for this ?

Thanks
# 4  
Old 03-27-2006
This is what i did :

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

and i got permission denied.
# 5  
Old 03-27-2006
Yes , u have to touch /etc/hosts as root

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

Cheers
# 6  
Old 03-27-2006
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
# 7  
Old 03-27-2006
Sorry , i was trying to explain that you have to modify the /etc/hosts (don“t touch it) for authentication as root using remsh ...
Login or Register to Ask a Question

Previous Thread | Next Thread

2 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Echoing silently?

I know, sounds mutually exclusive :-) I have a script where I ask for a password and store it in a variable, and then use it with sudo on an array of other hosts. The password winds up being choed back to my terminal as well as to the process on the remote host, like: Attempting to update... (2 Replies)
Discussion started by: jnojr
2 Replies

2. Shell Programming and Scripting

execute a command silently or quietly within a shell

How do I suspend output of commands and tools that sometimes utter unwanted output? I know that I can always pipe to null or some such thing, but is there a simpler more elegant (i.e. accepted) practice? (4 Replies)
Discussion started by: lumix
4 Replies
Login or Register to Ask a Question