May 28, 2003 #1 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.
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.
May 28, 2003 #2 mrn MIS Apr 27, 2001 3,993 GB Do a search for sudo on google.com -- | Mike Nixon | Unix Admin | ---------------------------- Upvote 0 Downvote
May 29, 2003 #3 dsn1 Technical User Oct 27, 2002 73 AU 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("fork" exit(1); } if (pid > 0) { execl ("/usr/bin/passwd" , "passwd" , argv[1] , 0); while (wait(&status) != pid); } } Upvote 0 Downvote
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("fork" exit(1); } if (pid > 0) { execl ("/usr/bin/passwd" , "passwd" , argv[1] , 0); while (wait(&status) != pid); } }