Forum
« sudo »

Welcome Guest. Please Login or Register.
May 20, 2013, 5:24pm



Return to or visit the SalineOS webpage

Forum :: General :: New Linux User Questions :: sudo
Page 1 of 2 » Jump to page   Go    [Search This Thread] [Share Topic] [Print]
 AuthorTopic: sudo (Read 880 times)
telltom
New Member
*
member is offline





Joined: Nov 2011
Gender: Male
Posts: 1
 sudo
« Thread Started on Nov 2, 2011, 5:10am »

hi folks,
just installed the os and i tried to use the terminal. I get an answer back, "you are not in the sudoers file. i'm new to linux so i'll read the manual, but in the meantime if you can help thanks.
Link to Post - Back to Top  IP: Logged
dyfi
New Member
*
member is offline





Joined: Jan 2011
Gender: Male
Posts: 26
 Re: sudo
« Reply #1 on Nov 2, 2011, 6:47am »

Go to accessories, open the root terminal. Use this command gedit /etc/sudoers in the file look for the line reading User privilege specification and below that you should see root =ALL ALL ALL. Change root to your user name and then close and save the file. Hope this works for you.
Link to Post - Back to Top  IP: Logged
aicardi
New Member
*
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 31
 Re: sudo
« Reply #2 on Nov 2, 2011, 9:37am »

Or just use su
Link to Post - Back to Top  IP: Logged
Anthony Nordquist
Administrator
*****
member is offline




[homepage]

Joined: Dec 2010
Gender: Male
Posts: 1,336
 Re: sudo
« Reply #3 on Nov 2, 2011, 11:40am »

The default user is not added to the sudoers file by default, as the system includes a root user. I use sudo on the live images since that is a dependency of the Debian Live scripts, and maintaining a fork of Debian Live without sudo would be a full time job in and of itself. You can use gksu in place of gksudo and su to change to the root user and issue commands.

You should not remove the root ALL=(ALL) ALL line as this will break Remastersys and my installer if you ever make a backup disk. You should add a new line directly below it
username ALL=(ALL) ALL

As of right now there is no way to disable the root user and use sudo exclusively on SalineOS. So the benefits of using sudo on an installed system are mute.
« Last Edit: Nov 2, 2011, 12:59pm by Anthony Nordquist »Link to Post - Back to Top  IP: Logged
aicardi
New Member
*
member is offline

[avatar]


[homepage]

Joined: Mar 2011
Gender: Male
Posts: 31
 Re: sudo
« Reply #4 on Nov 3, 2011, 10:31am »


Nov 2, 2011, 6:47am, dyfi wrote:
Go to accessories, open the root terminal. Use this command gedit /etc/sudoers

The proper way is to use the visudo command in the root terminal to do the editing of the /etc/sudoers file, this will make sure the file is properly edited without errors before it is saved.
Link to Post - Back to Top  IP: Logged
dyfi
New Member
*
member is offline





Joined: Jan 2011
Gender: Male
Posts: 26
 Re: sudo
« Reply #5 on Nov 3, 2011, 2:35pm »

Thank you Anthony, I have now corrected my sudoer file.

Dyfi
Link to Post - Back to Top  IP: Logged
Anthony Nordquist
Administrator
*****
member is offline




[homepage]

Joined: Dec 2010
Gender: Male
Posts: 1,336
 Re: sudo
« Reply #6 on Nov 4, 2011, 12:13pm »

I would just like to add that you can just add the user to the sudo group in order to enable sudo. You can do this from a root terminal by issuing the command:

gpasswd -a username sudo

Replace username with the username you have setup on the machine.

Its possible SalineOS will move to sudo and disable root for 2.0, but its hard to underestimate all the testing that needs done to make that merge smoothly.
Link to Post - Back to Top  IP: Logged
ukbrian
Senior Member
****
member is offline





Joined: Aug 2011
Gender: Male
Posts: 284
 Re: sudo
« Reply #7 on Nov 5, 2011, 6:54am »

Very interesting, I seem to have been doing things correctly for once with "gpasswd -a me sudo" and "sudo visudo" adding "username ALL=(ALL) ALL" to the bottom [image]

Regards
Quote:
Its possible SalineOS will move to sudo and disable root for 2.0, but its hard to underestimate all the testing that needs done to make that merge smoothly.
If everything works as it is with Saline is there really a need to change things if it involves a lot of work for you.
There must have been a reason you set it up using root but if you see a benefit in changing things I guess that the best time to change is now in the early days
Link to Post - Back to Top  IP: Logged
ukbrian
Senior Member
****
member is offline





Joined: Aug 2011
Gender: Male
Posts: 284
 Re: sudo
« Reply #8 on Nov 9, 2011, 8:59am »

I tell a lie about my sudoers file.
The actual entry I use is

Quote:
username ALL=(ALL) NOPASSWD:ALL

which is different from all the suggestions listed in this thread so I wonder which is the correct, approved method.
Link to Post - Back to Top  IP: Logged
Anthony Nordquist
Administrator
*****
member is offline




[homepage]

Joined: Dec 2010
Gender: Male
Posts: 1,336
 Re: sudo
« Reply #9 on Nov 9, 2011, 2:26pm »


Nov 9, 2011, 8:59am, ukbrian wrote:
I tell a lie about my sudoers file.
The actual entry I use is

Quote:
username ALL=(ALL) NOPASSWD:ALL

which is different from all the suggestions listed in this thread so I wonder which is the correct, approved method.


That is not a very good idea for security reasons is all I really have to say.
Link to Post - Back to Top  IP: Logged
beardedragon
Global Moderator
*****
member is offline

[avatar]



Joined: Feb 2011
Gender: Male
Posts: 857
 Re: sudo
« Reply #10 on Nov 9, 2011, 2:39pm »


Nov 9, 2011, 8:59am, ukbrian wrote:
I tell a lie about my sudoers file.
The actual entry I use is

Quote:
username ALL=(ALL) NOPASSWD:ALL

which is different from all the suggestions listed in this thread so I wonder which is the correct, approved method.

I'll have to agree with Anthony, this is not a good idea. To answer your question, the correct Approved Method above is:

Quote:
You should not remove the root ALL=(ALL) ALL line as this will break Remastersys and my installer if you ever make a backup disk. You should add a new line directly below it
username ALL=(ALL) ALL
« Last Edit: Nov 9, 2011, 2:42pm by beardedragon »Link to Post - Back to Top  IP: Logged

Robert Collard, Madison, WI
HP s5710f, 2x AMD Athlon II 260@3.2Ghz 3GB RAM, 640GB HD
Debian 7.0 XFCE-4.10 3.2.0-4-amd64

If you are satisfied with the results, please Edit your first post and add [Solved] to the Subject line.
ukbrian
Senior Member
****
member is offline





Joined: Aug 2011
Gender: Male
Posts: 284
 Re: sudo
« Reply #11 on Nov 9, 2011, 4:02pm »

When I noticed the difference between the two I thought I'd check by asking so I guess there's no harm in me making a video using the approved method in visudo.
Quote:
username ALL=(ALL) ALL
A little more knowledge gained.

Is there any problem with this other snippet that I use and was recommended to me to avoid having to click in multiple windows to do simple things like rebooting or shutting down
Quote:
me ALL=(root) NOPASSWD: /sbin/halt
me ALL=(root) NOPASSWD: /sbin/reboot
« Last Edit: Nov 10, 2011, 3:54am by ukbrian »Link to Post - Back to Top  IP: Logged
Anthony Nordquist
Administrator
*****
member is offline




[homepage]

Joined: Dec 2010
Gender: Male
Posts: 1,336
 Re: sudo
« Reply #12 on Nov 11, 2011, 2:27am »


Nov 9, 2011, 4:02pm, ukbrian wrote:
When I noticed the difference between the two I thought I'd check by asking so I guess there's no harm in me making a video using the approved method in visudo.
Quote:
username ALL=(ALL) ALL
A little more knowledge gained.

Is there any problem with this other snippet that I use and was recommended to me to avoid having to click in multiple windows to do simple things like rebooting or shutting down
Quote:
me ALL=(root) NOPASSWD: /sbin/halt
me ALL=(root) NOPASSWD: /sbin/reboot


This should be fairly safe.
Link to Post - Back to Top  IP: Logged
debby
Full Member
***
member is offline





Joined: Nov 2011
Gender: Male
Posts: 124
 Re: sudo
« Reply #13 on Nov 22, 2011, 1:18pm »

I have to say that as a new user simply tying to compile a linux ap which at one point asks for my password and then says I'm not on the list, NONE OF THE ABOVE works. I can log in as root but then the files I downloaded as user are not available. If I were to redownload them and compile in root would user be able to see and use them? I have already installed some stuff in order to facilitate the compilation. Will root see them? Not a real big deal as it is a synchronizer ap (freefilesync) but it would be nice to be able to be on the list occasionally. Giving user permanent root privileges is plain STUPID. I may as well just use the root acct-duhh. I read that it is better to create a separate file from the default than it is to modify it. I have no clue on how to do any of this, and nothing printed above works At All.Am I missing something here like logging in as root to begin with??????
« Last Edit: Nov 22, 2011, 1:23pm by debby »Link to Post - Back to Top  IP: Logged
beardedragon
Global Moderator
*****
member is offline

[avatar]



Joined: Feb 2011
Gender: Male
Posts: 857
 Re: sudo
« Reply #14 on Nov 22, 2011, 1:56pm »

@debby, a simple way that works:
Code:
su
password
thunar


Open File System> /etc/sudoers file
Add a line with
username ALL=(ALL) ALL

Replace username with your user name.
Save and exit. close Terminal then open fresh terminal and try it with something like :
Code:
sudo aptitude update

« Last Edit: Nov 22, 2011, 1:56pm by beardedragon »Link to Post - Back to Top  IP: Logged

Robert Collard, Madison, WI
HP s5710f, 2x AMD Athlon II 260@3.2Ghz 3GB RAM, 640GB HD
Debian 7.0 XFCE-4.10 3.2.0-4-amd64

If you are satisfied with the results, please Edit your first post and add [Solved] to the Subject line.
Page 1 of 2 » Jump to page   Go    [Search This Thread] [Share Topic] [Print]



Anthony Nordquist, on behalf of the SalineOS project, is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. As such, if you click the above banner and then make any purchase including digital downloads, a small percentage will be paid to the SalineOS project.
Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!
Terms of Service | Privacy Policy | Notice | FTC Disclosure | Report Abuse | Mobile