|
Author | Topic: sudo (Read 876 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.
| |
|
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.
| |
|
aicardi New Member
 member is offline
![[avatar] [avatar]](http://aicardi.net/spyder-A3_100.jpg)
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) Joined: Mar 2011 Gender: Male  Posts: 31
|  | Re: sudo « Reply #2 on Nov 2, 2011, 9:37am » | |
Or just use su
| |
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) 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.
| |
|
aicardi New Member
 member is offline
![[avatar] [avatar]](http://aicardi.net/spyder-A3_100.jpg)
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) 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.
| |
|
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
| |
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) 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.
| |
|
ukbrian Senior Member
    member is online
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] [image]](http://lin.me.uk/smilies/others/a-s-cheers-09.gif)
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
| |
|
ukbrian Senior Member
    member is online
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.
| |
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) 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.
| |
|
beardedragon Global Moderator
     member is offline
![[avatar] [avatar]](http://smile-media-production-1.s3.amazonaws.com/images/83a50d70550b01307b5322000afe0a5a/168x168.jpg)
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 |
|
|
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 online
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: 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
|
|
| |
|
Anthony Nordquist Administrator
     member is offline
![[homepage] [homepage]](http://images.proboards.com/new/buttons/www_sm.png) 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: 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.
| |
|
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??????
| |
|
beardedragon Global Moderator
     member is offline
![[avatar] [avatar]](http://smile-media-production-1.s3.amazonaws.com/images/83a50d70550b01307b5322000afe0a5a/168x168.jpg)
Joined: Feb 2011 Gender: Male  Posts: 857
|  | Re: sudo « Reply #14 on Nov 22, 2011, 1:56pm » | |
@debby, a simple way that works:
Code:
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:
|
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. |
|
|