cork1958 Posted July 26, 2013 Share Posted July 26, 2013 Just installed Debain Wheezy on another machine. I'm trying to figure out how to add myself to the sudoer list but when I try using visudo I get some error saying I'm not in the sudoers list. I've been searching around and everything says that I need to edit that file using visudo, which when I look for it in synaptic, nothing shows up, as in it's not installed or even available! So, how do I add myself to the sudoer list? Thank you Link to comment Share on other sites More sharing options...
+Majesticmerc MVC Posted July 26, 2013 MVC Share Posted July 26, 2013 How are you calling "visudo"? If you run the command while logged in as root you shouldn't have any issues. Visudo is included with the sudo package, which would be installed by default (my mistake, on many distros it is). Link to comment Share on other sites More sharing options...
cork1958 Posted July 26, 2013 Author Share Posted July 26, 2013 Sudo IS NOT installed by default as I already installed that. Learned that one from previous Debian installs. What I am trying to do is edit the host file, sudo mousepad /etc/hosts Edit: I just did it the hard way using su though, but still want to add myself to sudoer list. Link to comment Share on other sites More sharing options...
Brian M. Veteran Posted July 26, 2013 Veteran Share Posted July 26, 2013 You're trying to use sudo to add yourself to the sudoers file! You don't yet have permission to use sudo ;). Try "su root' - enter the root password, then add yourself to the sudoers file. Link to comment Share on other sites More sharing options...
cork1958 Posted July 26, 2013 Author Share Posted July 26, 2013 No, I wasn't trying to add myself using sudo!! I found the answer though: How to enable sudo for my user account on Debian 6? (still works on 7)Note:You will need the root password for this set of commands.Step1:Login to a user account.Step2:Open a terminal window and type this into your window:12 su rootadduser YOURUSERNAME sudoStep3:Now reboot, and on your next session you will be allowed to run every program or command, which doesnt belong to you, or you don?t have the rights for with This is the simple way instead of going through that goofy visudo junk!! Link to comment Share on other sites More sharing options...
+Majesticmerc MVC Posted July 26, 2013 MVC Share Posted July 26, 2013 No, I wasn't trying to add myself using sudo!! I found the answer though: How to enable sudo for my user account on Debian 6? (still works on 7) Note: You will need the root password for this set of commands. Step1: Login to a user account. Step2: Open a terminal window and type this into your window:1 2 su root adduser YOURUSERNAME sudo Step3: Now reboot, and on your next session you will be allowed to run every program or command, which doesnt belong to you, or you don?t have the rights for with This is the simple way instead of going through that goofy visudo junk!! Glad you got it sorted. Out of curiousity, what sequence of command were you trying to run? If you're running visudo as plain root, you wouldn't see any messages, and you can't run visudo without being root because /etc/sudoers is restricted to root access (otherwise any bozo could make themselves able to run an application with elevated privileges). Also, FWIW, just because you couldn't figure out how to use visudo doesn't make it junk ;). It serves the purpose of verifying a sudoers file after it has been edited to ensure that you don't nuke your OS. Link to comment Share on other sites More sharing options...
cork1958 Posted July 28, 2013 Author Share Posted July 28, 2013 Already forgot what commands I tried, but just plain su visudo did nothing! Yeah, I know it isn't junk, as I have used it before, and I worded it rather strongly. I just get frustrated to easily when I have to use the command line. I'm a complete moron when it comes to that!! :( Link to comment Share on other sites More sharing options...
Eric Veteran Posted July 28, 2013 Veteran Share Posted July 28, 2013 'su visudo' would attempt to log you in as the user "visudo" :) Link to comment Share on other sites More sharing options...
Recommended Posts