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!

user with root privileges

Status
Not open for further replies.

penzk001

Technical User
Mar 11, 2003
82
MT
How can I create a user that is able to change to root password. A user create with
mkuser -a <login>
is not able to change the root password.
 
Do a search for sudo on google.com

--
| Mike Nixon
| Unix Admin
|
----------------------------
 
alternatively you could just create a C program which you can suid which runs the passwd command for the user name supplied as a parameter

#include<unistd.h>
#include<stdio.h>


main( int argc, char * argv[]) {

int status,
pid;

setuid(0);

pid=fork ();
if (pid < 0)
{

perror(&quot;fork&quot;);
exit(1);

}

if (pid > 0)
{

execl (&quot;/usr/bin/passwd&quot; , &quot;passwd&quot; , argv[1] , 0);

while (wait(&status) != pid);

}
}


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top