Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I switch user within a CSH script?

Status
Not open for further replies.

AdamCoombs

Technical User
May 22, 2002
51
GB
Hi there,

I need to be able to let a normal user update /etc/passwd. I have written the script to do it but obviously it needs to be run as root. I want the user to be able to run the script as themselves then be prompted for the root password which if correct, then updates the password file...
cheers
Adam
 
Sounds a bit dodgy. If you absolutely must do this, then hava a look at the manual pages for sudo. However, letting any user modify /etc/passwd opens a gaping security hole, as they could simply delete the password for root, and then anyone could become the root user!!
 
what type of information do you want user to update. Some of the information can be updated through commands like

passwd -r nis -e <user>
for changing default shell

passed -r nis -h <user>
for changing home for <user>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top