MEWBIES@:  Facebook  Twitter  G+  YouTube  DeviantArt  Forum  Wall
 SHARE:
    ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
   ██                                                                       ██
  █▌                       -   SUDO HEADACHE?   -                            █▌
 █▌                                                                           █▌
 █                                                                            ▐▌
 █ SUDO ERRORS:                                                               ▐▌
 █ ````````````                                                               ▐▌
 █ 1. bash: sudo: command not found                                           ▐▌
 █ Debian doesn't come with sudo:                                             ▐▌
 █ su                                                                         ▐▌
 █ aptitude install sudo                                                      ▐▌
 █ will reply: No /etc/sudoers found... creating one for you.                 ▐▌
 █ exit                                                                       ▐▌
 █                                                                            ▐▌
 █ 2. sudo: unable to resolve host yourserver.com                             ▐▌
 █ Check if your 'hostname' is in your 'hosts' file, if not add it like this: ▐▌
 █ Find out what your host name is:                                           ▐▌
 █ cat /etc/hostname                                                          ▐▌
 █ For example reply will be similar to:                                      ▐▌
 █ ABC123abc.yourserver.com                                                   ▐▌
 █ su                                                                         ▐▌
 █ hostname --fqdn                                                            ▐▌
 █ reply: hostname: Unknown host                                              ▐▌
 █                                                                            ▐▌
 █ pico /etc/hosts                                                            ▐▌
 █ Has this:                                                                  ▐▌
 █ 127.0.0.1       localhost                                                  ▐▌
 █ 208/87.33.151   ABC123abc.yourserver.com.yourserver.com  ABC123abc         ▐▌
 █                                                                            ▐▌
 █ # The following lines are desirable for IPv6 capable hosts                 ▐▌
 █ ::1     ip6-localhost ip6-loopback                                         ▐▌
 █ fe00::0 ip6-localnet                                                       ▐▌
 █ ff00::0 ip6-mcastprefix                                                    ▐▌
 █ ff02::1 ip6-allnodes                                                       ▐▌
 █ ff02::2 ip6-allrouters                                                     ▐▌
 █ ff02::3 ip6-allhosts                                                       ▐▌
 █                                                                            ▐▌
 █ Add the reply from cat /etc/hostname to the 1st line, for example (use tab ▐▌
 █ key for spaces):                                                           ▐▌
 █ 127.0.0.1       localhost       ABC123abc.yourserver.com                   ▐▌
 █ 208/87.33.151   ABC123abc.yourserver.com.yourserver.com  ABC123abc         ▐▌
 █                                                                            ▐▌
 █ # The following lines are desirable for IPv6 capable hosts                 ▐▌
 █ ::1     ip6-localhost ip6-loopback                                         ▐▌
 █ fe00::0 ip6-localnet                                                       ▐▌
 █ ff00::0 ip6-mcastprefix                                                    ▐▌
 █ ff02::1 ip6-allnodes                                                       ▐▌
 █ ff02::2 ip6-allrouters                                                     ▐▌
 █ ff02::3 ip6-allhosts                                                       ▐▌
 █                                                                            ▐▌
 █ now when you do:                                                           ▐▌
 █ hostname --fqdn                                                            ▐▌
 █ It should reply similar to:                                                ▐▌
 █ localhost                                                                  ▐▌
 █                                                                            ▐▌
 █ exit                                                                       ▐▌
 █                                                                            ▐▌
 █ 3. sudo -bash: Permission denied:                                          ▐▌
 █ To read about sudo and sudo users (q key to quit the man window):          ▐▌
 █ man sudo                                                                   ▐▌
 █ man sudoers                                                                ▐▌
 █ Or if you would like to read it on line it's HERE.                         ▐▌
 █ To find out if you are allowed to sudo:                                    ▐▌
 █ sudo -l                                                                    ▐▌
 █ If you are reply will be similar to:                                       ▐▌
 █ User yourname may run the following commands on this host:                 ▐▌
 █     (ALL) NOPASSWD: ALL                                                    ▐▌
 █     (ALL) ALL                                                              ▐▌
 █                                                                            ▐▌
 █ You can add yourself as admin or adm if you are in that group or add       ▐▌
 █ yourself as a user.                                                        ▐▌
 █ To find out if you are in the admin group, whether it's admin OR adm, and  ▐▌
 █ while you are there you can add yourself/user's name to admin group if you ▐▌
 █ need:                                                                      ▐▌
 █ su                                                                         ▐▌
 █ pico /etc/group                                                            ▐▌
 █ Mine had this:                                                             ▐▌
 █ adm:x:4:                                                                   ▐▌
 █                                                                            ▐▌
 █ I changed it to:                                                           ▐▌
 █ adm:x:4:mewbie                                                             ▐▌
 █                                                                            ▐▌
 █                                                                            ▐▌
 █ Or you could: adduser user group, for example:                             ▐▌
 █ adduser mewbie adm                                                         ▐▌
 █                                                                            ▐▌
 █ Now to add to users to the sudoers file                                    ▐▌
 █ To add user in admin group, add 1 of these lines:                          ▐▌
 █ %admin          ALL=(ALL) ALL                                              ▐▌
 █ OR                                                                         ▐▌
 █ %adm            ALL=(ALL) ALL                                              ▐▌
 █                                                                            ▐▌
 █ To add yourself as a user by adding this line (change username to your     ▐▌
 █ name):                                                                     ▐▌
 █ username     ALL=(ALL) ALL                                                 ▐▌
 █                                                                            ▐▌
 █ visudo                                                                     ▐▌
 █ This will open /etc/sudoers.tmp and then put the changes into /etc/sudoers ▐▌
 █ Do not edit that file directly, only use 'visudo'.                         ▐▌
 █ I added for admins and myself. Mine in these sections had this:            ▐▌
 █ # Members of the admin group may gain root privileges                      ▐▌
 █                                                                            ▐▌
 █ # User privilege specification                                             ▐▌
 █ root    ALL=(ALL) ALL                                                      ▐▌
 █                                                                            ▐▌
 █ # Uncomment to allow members of group sudo to not need a password          ▐▌
 █ # (Note that later entries override this, so you might need to move        ▐▌
 █ # it further down)                                                         ▐▌
 █ # %sudo ALL=NOPASSWD: ALL                                                  ▐▌
 █                                                                            ▐▌
 █                                                                            ▐▌
 █ I changed it to:                                                           ▐▌
 █ # Members of the admin group may gain root privileges                      ▐▌
 █ %adm    ALL=(ALL)       NOPASSWD:ALL                                       ▐▌
 █                                                                            ▐▌
 █ # User privilege specification                                             ▐▌
 █ root    ALL=(ALL) ALL                                                      ▐▌
 █ mewbie   ALL=(ALL) ALL                                                     ▐▌
 █                                                                            ▐▌
 █ # Uncomment to allow members of group sudo to not need a password          ▐▌
 █ # (Note that later entries override this, so you might need to move        ▐▌
 █ # it further down)                                                         ▐▌
 █ # %sudo ALL=NOPASSWD: ALL                                                  ▐▌
 █                                                                            ▐▌
 █ Save and exit by using Ctrl + X keys.                                      ▐▌
 █ To view your changes:                                                      ▐▌
 █ cat /etc/sudoers                                                           ▐▌
 █                                                                            ▐▌
 █ Or to give admin rights to users:                                          ▐▌
 █ sudo usermod -G admin username                                             ▐▌
 █ exit                                                                       ▐▌
 █                                                                            ▐▌
 █ HERE is an easy read for more information about sudo.                      ▐▌
 █                                                                            ▐▌
 █ //----------------------------------------------------------------------   ▐▌
 █                                                                            ▐▌
 █ If you find mistakes, have suggestions, and or questions please post at    ▐▌
 █ mewbies forum HERE - thank you.                                            ▐▌
 █                                                                            ▐▌
 █ Last update on 14 Aug '09                                                  ▐▌
 █                                                                            ▐▌
 █▌                                                                           █▌
  █▌                          -   mewbies.com   -                            █▌
   █▌                                                                       █▌
    ██▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄██