Add a User with Root Priviledges

This info take from http://www.voiceie.com/cgi-bin/ultimatebb.cgi?ubb=get_topic;f=2;t=000238

  • Boot CentOS and use linux rescue and chroot to the CCM drive.
  • Add a user superuser
chroot /mnt/sysimage
chattr -i /etc/passwd /etc/group /etc/shadow /etc/gshadow
useradd -g root -G root,wheel -s /bin/bash superuser
passwd superuser
  • edit /etc/passwd and give root the shell /bin/bash (replace /sbin/nologin with /bin/bash) (needed to su)
  • edit /etc/pam.d/su and comment the line:
# auth required /lib/security/$ISA/pam_wheel.so group=priviledged_grp
  • uncomment the line:
auth sufficient /lib/security/$ISA/pam_wheel.so trust use_uid
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies