Jump to content



Photo

Edit sudoer list Debian Wheezy

Answered Go to the full post

  • Please log in to reply
7 replies to this topic

#1 cork1958

cork1958

    Neowinian

  • Tech Issues Solved: 2
  • Joined: 04-October 02

Posted 26 July 2013 - 12:41

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



Best Answer cork1958 , 26 July 2013 - 13:01

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!!

Go to the full post



#2 +Majesticmerc

Majesticmerc

    Resident Idealist

  • Tech Issues Solved: 9
  • Joined: 24-August 05
  • Location: United Kingdom
  • OS: Arch Linux / Win 7
  • Phone: HTC One X

Posted 26 July 2013 - 12:44

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).



#3 OP cork1958

cork1958

    Neowinian

  • Tech Issues Solved: 2
  • Joined: 04-October 02

Posted 26 July 2013 - 12:50

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.



#4 Brian M.

Brian M.

    Neowinian Senior

  • Tech Issues Solved: 11
  • Joined: 07-January 05
  • Location: London, UK

Posted 26 July 2013 - 12:57

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.



#5 OP cork1958

cork1958

    Neowinian

  • Tech Issues Solved: 2
  • Joined: 04-October 02

Posted 26 July 2013 - 13:01   Best Answer

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!!



#6 +Majesticmerc

Majesticmerc

    Resident Idealist

  • Tech Issues Solved: 9
  • Joined: 24-August 05
  • Location: United Kingdom
  • OS: Arch Linux / Win 7
  • Phone: HTC One X

Posted 26 July 2013 - 20:56

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.



#7 OP cork1958

cork1958

    Neowinian

  • Tech Issues Solved: 2
  • Joined: 04-October 02

Posted 28 July 2013 - 12:18

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!! :(



#8 Eric

Eric

    Neowinian Senior

  • Tech Issues Solved: 13
  • Joined: 02-August 06
  • Location: Greenville, SC

Posted 28 July 2013 - 12:36

'su visudo' would attempt to log you in as the user "visudo" :)