VectorLinux

Please login or register.

Login with username, password and session length
Advanced search  

News:

Visit our home page for VL info. For support and documentation, visit the Vector Linux Knowledge Center or search the Knowledge Center and this Forum using the search box above.

Author Topic: how can I allow another user to "sudo" anything root can do?  (Read 3299 times)

majinzero

  • Member
  • *
  • Posts: 11

I have another user account, not root, and whenever I sudo something; it says I do not have the appropriate permissions. How can that be changed?
Logged

GrannyGeek

  • Packager
  • Vectorian
  • ****
  • Posts: 2567
Re: how can I allow another user to "sudo" anything root can do?
« Reply #1 on: May 20, 2007, 08:58:30 pm »

Why are you using sudo? Perhaps you are used to Ubuntu.

In VectorLinux, if you as user need to do something that requires root, use su. Open a terminal and type
su
at the prompt. Then type the root password. You can now run commands reserved for root and do other root things, such as edit system files, create directories somewhere other than in your home directory, install software system wide, etc.

When you're finished with whatever you need to do, type
exit
at the terminal prompt. That will return you to your user account.

If the situation is that you want your user to be able to do some things that require root privileges without revealing the root password to that user, you can add the user to groups that have permission to do the desired things. If that's not enough, you as root can edit /etc/sudoers to let a particular user sudo to have access to some commands.

I don't know much about editing /etc/sudoers, so if you need more information about that, someone else will have to step in.
--GrannyGeek
« Last Edit: May 20, 2007, 09:06:01 pm by GrannyGeek »
Logged
Registered Linux User #397786

Happily running VL 7 Gold on  a Sempron LE-1300 desktop (2.3 GHz), 4 G RAM,  GeForce 6150 SE onboard graphics and on an HP Pavilion dv7 i7, 6 gigs, Intel 2nd Generation Integrated Graphics Controller

saulgoode

  • Vectorite
  • ***
  • Posts: 340
Re: how can I allow another user to "sudo" anything root can do?
« Reply #2 on: May 21, 2007, 01:38:35 am »

You can add a line such as:

majinzero   ALL=NOPASSWD:ALL

to your '/etc/sudoers' file and then the user named "majinzero" will be able to perform operations as root using the 'sudo' command.

The 'sudoers' file is fairly well commented and you should be able to figure out the other options available to you. See also the manual page on "sudoers".
Logged
A complex system that works is invariably found to have evolved from a simple system that works.

forbajato

  • Packager
  • Member
  • ****
  • Posts: 46
Re: how can I allow another user to "sudo" anything root can do?
« Reply #3 on: May 21, 2007, 07:17:35 am »

Note that to edit the /etc/sudoers file you will need to be root and use visudo rather than your usual editor - sudoers file won't allow any other editor to change it.

forbajato
Logged

Joe1962

  • Administrator
  • Vectorian
  • *****
  • Posts: 2499
    • Joe1962's Website
Re: how can I allow another user to "sudo" anything root can do?
« Reply #4 on: May 21, 2007, 09:54:06 am »

Note that to edit the /etc/sudoers file you will need to be root and use visudo rather than your usual editor - sudoers file won't allow any other editor to change it.
Actually, you can use any editor you want, but it's supposed to be very dangerous not to use visudo. The word is you can leave your system inaccessible with a bad sudo file and visudo checks the format before saving. That said, I only tried visudo once or twice before starting to use mcedit, kate, mousepad, or whatever... ::)
« Last Edit: May 21, 2007, 10:02:10 am by Joe1962 »
Logged
O'Neill (RE the Asgard): "Usually they ask nicely before they ignore us and do what they damn well please."
http://joe1962.bigbox.info
Running: VL 7 Std 64 + self-cooked XFCE-4.10

Triarius Fidelis

  • Vecteloper
  • Vectorian
  • ****
  • Posts: 2399
  • Domine, exaudi vocem meam
    • my website
Re: how can I allow another user to "sudo" anything root can do?
« Reply #5 on: May 21, 2007, 08:14:56 pm »

You can have your cake and eat it, too. Just set $VISUAL or $EDITOR to program of choice.

(Myself, I'm fine with using the crappy vi clone we have by default...)
Logged
"Leatherface, you BITCH! Ho Chi Minh, hah hah hah!"

Formerly known as "Epic Fail Guy" and "Döden" in recent months