 |
 |
 |
 |
| Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum. |

18th April 2011, 07:38 PM
|
 |
Registered User
|
|
Join Date: Mar 2011
Location: Cincinnati, Ohio
Age: 23
Posts: 99

|
|
|
Add user to Sudoers File?
How do I add myself to the Sudoers File? When I go to use the "Sudo" command, it tells me I am not in the Sudoers File, so I have to do "su -" to bypass it for the time being. How do I add myself? Thanks
David
__________________
I do not know why I left Fedora for Ubuntu, please I ask of you to forgive me O Blessed One, I shall never betray you again...
[SIGPIC][/SIGPIC]
|

18th April 2011, 07:51 PM
|
 |
Registered User
|
|
Join Date: Apr 2011
Location: Finland
Posts: 293

|
|
|
Re: Add user to Sudoers File?
Sudoers file is located in /etc/sudoers. It should have examples inside of what you need to add.
|

18th April 2011, 07:58 PM
|
 |
Registered User
|
|
Join Date: Mar 2011
Location: Cincinnati, Ohio
Age: 23
Posts: 99

|
|
|
Re: Add user to Sudoers File?
Quote:
Originally Posted by Miikka
Sudoers file is located in /etc/sudoers. It should have examples inside of what you need to add.
|
I do not have an /etc/sudoers file, I have an /etc/sudoers.d file and when I open it it says that it can not open the file. What do I do?
__________________
I do not know why I left Fedora for Ubuntu, please I ask of you to forgive me O Blessed One, I shall never betray you again...
[SIGPIC][/SIGPIC]
|

18th April 2011, 08:08 PM
|
 |
Registered User
|
|
Join Date: Nov 2010
Age: 25
Posts: 55

|
|
|
Re: Add user to Sudoers File?
Quote:
Originally Posted by AgentTeddie
How do I add myself to the Sudoers File? When I go to use the "Sudo" command, it tells me I am not in the Sudoers File, so I have to do "su -" to bypass it for the time being. How do I add myself? Thanks
David
|
Run:
Enter your password then scroll down to the line that says:
Code:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
Add the following line directly after the above, where "username" is your user name:
Code:
username ALL=(ALL) ALL
Scroll down to the following line
Code:
## Allows people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
Remove the # in front of the second line
That's how I did it, anyway. I actually didn't need to the last part for it to work, so I'm not sure what it does. It's just how I learned to do it when I first got started.
|

18th April 2011, 08:09 PM
|
|
Registered User
|
|
Join Date: Apr 2011
Posts: 14

|
|
|
Re: Add user to Sudoers File?
use
it will open the file /etc/sudoers
then
copy the line with yy command
root ALL=(ALL) ALL
and rename it to
"username u want to add" ALL=(ALL) ALL
save the file
now u r in sudo
|

18th April 2011, 08:12 PM
|
|
Registered User
|
|
Join Date: Nov 2010
Location: Oklahoma
Age: 19
Posts: 62

|
|
|
Re: Add user to Sudoers File?
FedoraPlus does it for you too.
FedoraPlus
__________________
Computer Spec:
AMD 3.0 GHz Quad Core
4 GB DDR3 RAM
320 GB Samsung HDD
GIGABYTE Motherboard
Nvidia GT 430
Crappy Old Dell 15" CRT Monitor
Fedora 15 64 Bit
|

18th April 2011, 08:34 PM
|
 |
Registered User
|
|
Join Date: Mar 2011
Location: Cincinnati, Ohio
Age: 23
Posts: 99

|
|
|
Re: Add user to Sudoers File?
Quote:
Originally Posted by blackplague1347
Run:
Enter your password then scroll down to the line that says:
Code:
## Allow root to run any commands anywhere
root ALL=(ALL) ALL
Add the following line directly after the above, where "username" is your user name:
Code:
username ALL=(ALL) ALL
Scroll down to the following line
Code:
## Allows people in group wheel to run all commands
# %wheel ALL=(ALL) ALL
Remove the # in front of the second line
That's how I did it, anyway. I actually didn't need to the last part for it to work, so I'm not sure what it does. It's just how I learned to do it when I first got started.
|
I did this but how do I save it? I cannot figure out how to get out of it?
__________________
I do not know why I left Fedora for Ubuntu, please I ask of you to forgive me O Blessed One, I shall never betray you again...
[SIGPIC][/SIGPIC]
|

18th April 2011, 08:38 PM
|
 |
Registered User
|
|
Join Date: Nov 2010
Age: 25
Posts: 55

|
|
|
Re: Add user to Sudoers File?
Quote:
Originally Posted by AgentTeddie
I did this but how do I save it? I cannot figure out how to get out of it?
|
You can save and exit the file by pressing "esc" to get into command mode (after making the necessary changes to the file) and then type ":wq" which Writes to disk and Quits.
|

18th April 2011, 09:09 PM
|
 |
Registered User
|
|
Join Date: Mar 2011
Location: Cincinnati, Ohio
Age: 23
Posts: 99

|
|
|
Re: Add user to Sudoers File?
Quote:
Originally Posted by blackplague1347
You can save and exit the file by pressing "esc" to get into command mode (after making the necessary changes to the file) and then type ":wq" which Writes to disk and Quits.
|
That for me does not work, I hit ESC and it does nothing...
---------- Post added at 04:06 PM ---------- Previous post was at 03:47 PM ----------
SO how do I save because when I hit ESC nothing happens, it will not let me type?
---------- Post added at 04:09 PM ---------- Previous post was at 04:06 PM ----------
Nevermind I found out how a much easier way! Thanks for the help though!
__________________
I do not know why I left Fedora for Ubuntu, please I ask of you to forgive me O Blessed One, I shall never betray you again...
[SIGPIC][/SIGPIC]
|

18th April 2011, 09:17 PM
|
 |
Registered User
|
|
Join Date: Apr 2011
Location: Finland
Posts: 293

|
|
|
Re: Add user to Sudoers File?
Quote:
Originally Posted by AgentTeddie
Nevermind I found out how a much easier way! Thanks for the help though!
|
Please share your knowledge so people who are having same problems and have found this thread can solve their problems as well.
|

18th April 2011, 09:24 PM
|
 |
Un-Retired Administrator
|
|
Join Date: Mar 2004
Location: Salem, Mass USA
Posts: 13,933

|
|
|
Re: Add user to Sudoers File?
As root type echo 'username ALL=(ALL) ALL' >> /etc/sudoers. Obviously substitute username for your username
__________________
Glenn
The Bassinator © ®
Laptop: Toshiba Satellite / Intel Core 2 Duo 1.73 GHz / 2GB / 160GB / Intel Mobile 945GM/GMS/GME/943/940GML Integrated Graphics
Desktop: BioStar MCP6PB M2+ / AMD Phenom 9750 Quad Core / 4GB / 1TB SATA / 500GB SATA / EVGA GeForce 8400 GS 1GB
|

18th April 2011, 09:26 PM
|
 |
Registered User
|
|
Join Date: Mar 2011
Location: Cincinnati, Ohio
Age: 23
Posts: 99

|
|
|
Re: Add user to Sudoers File?
This website is what helped me!
http://www.mjmwired.net/resources/mj...-fc6.html#sudo
---------- Post added at 04:26 PM ---------- Previous post was at 04:25 PM ----------
Quote:
Originally Posted by glennzo
As root type echo 'username ALL=(ALL) ALL' >> /etc/sudoers. Obviously substitute username for your username 
|
That is what I did to do it!
__________________
I do not know why I left Fedora for Ubuntu, please I ask of you to forgive me O Blessed One, I shall never betray you again...
[SIGPIC][/SIGPIC]
|

18th April 2011, 09:30 PM
|
 |
Registered User
|
|
Join Date: Jul 2006
Location: Montana
Posts: 731

|
|
|
Re: Add user to Sudoers File?
Quote:
Originally Posted by Miikka
Please share your knowledge so people who are having same problems and have found this thread can solve their problems as well.
|
"easy" method is to use an alternate editor.
visudo is preferred as it (visudo) checks for syntax errors. Not as critical on Fedora as on Ubuntu as the root account is not locked.
1. become root
2. Set your editor
If you do not like nano, use another tool, gedit, kate, leafpad, etc.
3. Edit away
Also, FYI, when editing your sudoers file, keep in mind the "last match" for your user (often) takes precidence.
So, I would advise you use:
on a single user system, or
on a multi user system where you want to grant root privileges to a group of users, but not both.
See also: http://www.gratisoft.us/sudo/sudoers.man.html
__________________
If it is not broken, tweak it... If you break Fedora you get to keep both pieces :p
|

17th June 2012, 03:36 AM
|
|
Registered User
|
|
Join Date: Jun 2012
Location: San Diego, CA
Posts: 3

|
|
|
Re: Add user to Sudoers File?
Quote:
Originally Posted by glennzo
As root type echo 'username ALL=(ALL) ALL' >> /etc/sudoers. Obviously substitute username for your username 
|
PLEASE NOTE: this command no longer works, at least not on a clean install of FC 17. It *did* work using the live disc, which is odd. But on an install, nope.
The notes in the sudoers file read:
This file must be edited with the 'visudo' command. This means echo doesn't work, and you can't open sudoers with gedit. Apparently visudo checks the syntax of any changes before saving, and won't allow you to save if it's wrong.
So scratch that old trick off your list. It's been deprecated. Now, all you have to do to add your user name to /etc/sudoers is...
-switch to root
-run visudo
-figure out how the hell to use visudo, which is as easy as learning to use vi
Easy!
Last edited by Willard McJimbe; 17th June 2012 at 03:37 AM.
Reason: clarification
|

17th June 2012, 01:12 PM
|
|
Registered User
|
|
Join Date: Jan 2010
Posts: 4,979

|
|
|
Re: Add user to Sudoers File?
visudo uses the default editor--for example, on Ubuntu, I think it will open with nano.
If you prefer nano you could probably use
Code:
su
EDITOR=nano
visudo
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
Current GMT-time: 17:47 (Friday, 24-05-2013)
|
|
 |
 |
 |
 |
|
|