|
Bugzilla – Full Text Bug Listing |
| Summary: | Changing the name of the root user, sudo does not authorize. | ||
|---|---|---|---|
| Product: | Sudo | Reporter: | baris <baris4> |
| Component: | Sudo | Assignee: | Todd C. Miller <Todd.Miller> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | low | ||
| Version: | 1.8.4 | ||
| Hardware: | PC | ||
| OS: | Other | ||
|
Description
baris
2012-08-05 18:09:15 MDT
I'm not sure I understand you. Sudo runs commands as user "root" by default. If you change root's uid to something other than 0, sudo will run commands as whatever uid "root" has in the passwd file. If root has a non-zero uid, that would explain why you can run "sudo reboot". You will need to add a line to sudoers like: Defaults runas_default root2 if root2 is the "real" (ie: uid 0) root user. Thanks for answer. My /etc/passwd file root2:x:0:0::/home/root2:/bin/sh usersun:x:999:999::/home/sun:/bin/bash MY /etc/sudoers Defaults env_reset root2 ALL=(ALL) ALL usersun ALL=(ALL) NOPASSWD: /sbin/reboot , /bin/ln , /usr/bin/apt-get , /bin/kill , /usr/bin/killall , /usr/bin/pkill , /usr/local/bin/* , /usr/bin/crontab , /usr/sbin/usermod ERROR MASSAGE usersun@test:~$ sudo reboot reboot: must be superuser. I'm surprised you don't get a message from sudo like this: sudo: unknown user: root sudo: unable to initialize policy plugin But either way, since sudo looks up the root user by name, you need to tell it to run things as "root2". There was a typo in the Defaults entry I entered earlier, it should be: Defaults runas_default=root2 Once you have that in your sudoers file you should be able to run reboot. Defaults runas_default=root2 It's okey. thanks |