01/09/09

usuario como root

este tip pretende ilustrar como hacer que un usuario, (en este caso, whilo) tenga todos los privilegios como root


1.- lo primero es hacer el usuario, miembro del grupo root
en el fichero /etc/passwd
el usuario normal es
whilo:x:1000:1000:whilo,,,:/home/whilo:/bin/bash

ahora debe ser
whilo:x:0:0:whilo,,,:/home/whilo:/bin/bash

se cambia el uid de 1000 a 0 pues el uid del root es cero

2.-
en el fichero /etc/group
el grupo root viene por defecto
root:x:0:

hay que annadirle al usuario whilo
root:x:0:whilo

3.-
editar el fichero /etc/sudoers
y annadirle

whilo ALL=(ALL) ALL
whilo ALL= NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/halt, /sbin/fdisk, /sbin/ifup, /sbin/ifdown, /sbin/init, /sbin/sulogin
whilo ALL= NOPASSWD: /usr/bin/apt-get update
whilo ALL= NOPASSWD: /usr/bin/apt-get install
whilo ALL= NOPASSWD: /usr/bin/apt-get upgrade
whilo ALL= NOPASSWD: /usr/bin/apt-get dist-upgrade
whilo ALL= NOPASSWD: /usr/bin/apt-get purge
whilo ALL= NOPASSWD: /usr/bin/apt-get remove
whilo ALL= NOPASSWD: /usr/bin/apt-get autoremove
whilo ALL= NOPASSWD: /usr/bin/apt-get clean
whilo ALL= NOPASSWD: /usr/bin/apt-get autoclean
whilo ALL= NOPASSWD: /usr/bin/apt-cache
whilo ALL= NOPASSWD: /usr/bin/apt-get dselect-upgrade
whilo ALL= NOPASSWD: /usr/bin/aptitude update
whilo ALL= NOPASSWD: /usr/bin/aptitude install
whilo ALL= NOPASSWD: /usr/bin/aptitude dist-upgrade
whilo ALL= NOPASSWD: /usr/bin/aptitude safe-upgrade
whilo ALL= NOPASSWD: /usr/bin/aptitude full-upgrade
whilo ALL= NOPASSWD: /usr/bin/aptitude show
whilo ALL= NOPASSWD: /usr/bin/aptitude clean
whilo ALL= NOPASSWD: /usr/bin/aptitude autoclean
whilo ALL= NOPASSWD: /usr/bin/aptitude remove
whilo ALL= NOPASSWD: /usr/bin/aptitude purge
whilo ALL= NOPASSWD: /usr/bin/aptitude dselect-upgrade
whilo ALL= NOPASSWD: /usr/bin/aptitude search