Can'tedit anything-Sudoers file? [SOLVED]
Can'tedit anything-Sudoers file? [SOLVED]
I have attempted a couple of things on my new install of Salix. Nothing has worked. I am a noob to linux in general and a super noob to Salix. The thing I am trying to do at the moment is edit my conky config file. I can open it and edit it but I can't save it. Also when I try to do things in the terminal I get a "not in the sudoers file" followed by a threat to report me to me, as I am the sole user of this machine. I would like to add myself to the sudoers file but I don't know where it is or how. I believe if I get into the sudoers club things will be fine for a while.
Last edited by travalon on 14. Jul 2012, 15:34, edited 1 time in total.
- Tim CowChip
- Posts: 304
- Joined: 27. May 2011, 03:35
- Location: Cascade Locks, OR
Re: Can'tedit anything-Sudoers file?
Without stating exactly what you attempted to do, nobody can help you.travalon wrote:I have attempted a couple of things on my new install of Salix. Nothing has worked.
Too many problems with this one. First, you have a lack of understanding file ownerships and permissions. It's obvious that you don't have permissions to edit that file you're talking about. Here's a quick introduction: http://www.tuxfiles.org/linuxhelp/filepermissions.htmltravalon wrote:The thing I am trying to do at the moment is edit my conky config file. I can open it and edit it but I can't save it. Also when I try to do things in the terminal I get a "not in the sudoers file" followed by a threat to report me to me, as I am the sole user of this machine. I would like to add myself to the sudoers file but I don't know where it is or how. I believe if I get into the sudoers club things will be fine for a while.
Since you say it's a conkyrc file, I doubt it's a system file. It's most probably a file that you used in a previous /home directory, created with another distribution, using different user credentials (most importantly UID).
Now, about the "sudoers" thing. The answer to how do you get into the sudoers club, is "run visudo as root, so you can edit the sudoers file". But I don't think that's what you expected. Also, here's an FAQ on that: http://polishlinux.org/first-steps/root ... /sudo-faq/
Why are you trying to use sudo? And how do you think it would work? This is not ubuntu. sudo is not configured by default the same it is configured in ubuntu and thus it cannot be used by default the same way as it does in ubuntu. You can in fact configure it the same way, but you need to understand what you're doing and do it yourself. In slackware/salix, the su command (or gksu or kdesu for the graphic equivalents) is used to login as the root user and run commands as that user.
Re: Can'tedit anything-Sudoers file?
I'm a noob too when it comes to Slackware/Salix. I'll try to explain the way i did it.travalon wrote:I have attempted a couple of things on my new install of Salix. Nothing has worked. I am a noob to linux in general and a super noob to Salix. The thing I am trying to do at the moment is edit my conky config file. I can open it and edit it but I can't save it. Also when I try to do things in the terminal I get a "not in the sudoers file" followed by a threat to report me to me, as I am the sole user of this machine. I would like to add myself to the sudoers file but I don't know where it is or how. I believe if I get into the sudoers club things will be fine for a while.
1. To edit most files in Linux you have to be ROOT, except if the file belongs to you (if it is in the /home file) then you can do it as travalon (user). Clear as mud?
2. You are trying to edit your .conkyrc file which is a "dot file" and is in your /home directory, therefore, you can do this as 'user'.
Example:
Code: Select all
$ nano .conkyrc
edit the file and then save and exit.
Control + o saves the file
Control + x exits the editor nano
Done!
The file /etc/sudoers is outside your /home, thus you have to become ROOT, launch a terminal:
Code: Select all
$ su
password: type here your root password
and you become ROOT when you see the hash mark (#)
Code: Select all
# nano /etc/sudoers
edit, adding the line you want to the file.
(i added myself to the group 'wheel' and uncommented the line for those belonging to that group)
## Same thing without a password
%wheel ALL=(ALL) NOPASSWD: ALL
save/exit
Code: Select all
$ nano .bashrc
and add this line:
export PATH=/sbin:/usr/sbin:$PATH
save/exit
when you come back try using sudo:
Code: Select all
macondo[~]$ sudo slapt-get -u
Retrieving package data [http://salix.enialis.net/i486/slackware-13.37/]...Cached
Retrieving patch list [http://salix.enialis.net/i486/slackware-13.37/]...Cached
Retrieving checksum list [http://salix.enialis.net/i486/slackware-13.37/]...Done
Retrieving checksum signature [http://salix.enialis.net/i486/slackware-13.37/]...Cached
Verifying checksum signature [http://salix.enialis.net/i486/slackware-13.37/]...No key for verification
Retrieving ChangeLog.txt [http://salix.enialis.net/i486/slackware-13.37/]...Cached
Reading Package Lists...Done
Retrieving package data [http://salix.enialis.net/i486/slackware-13.37/extra/]...Cached
Retrieving patch list [http://salix.enialis.net/i486/slackware-13.37/extra/]...Done
Retrieving checksum list [http://salix.enialis.net/i486/slackware-13.37/extra/]...Done
Retrieving checksum signature [http://salix.enialis.net/i486/slackware-13.37/extra/]...Cached
Verifying checksum signature [http://salix.enialis.net/i486/slackware-13.37/extra/]...No key for verification
Retrieving ChangeLog.txt [http://salix.enialis.net/i486/slackware-13.37/extra/]...Done
Reading Package Lists...Done
Retrieving package data [http://salix.enialis.net/i486/13.37/]...Cached
Retrieving patch list [http://salix.enialis.net/i486/13.37/]...Done
Retrieving checksum list [http://salix.enialis.net/i486/13.37/]...Cached
Retrieving checksum signature [http://salix.enialis.net/i486/13.37/]...Cached
Verifying checksum signature [http://salix.enialis.net/i486/13.37/]...No key for verification
Retrieving ChangeLog.txt [http://salix.enialis.net/i486/13.37/]...Cached
Reading Package Lists...Done
macondo[~]$ sudo slapt-get --upgrade
Reading Package Lists...Done
0 upgraded, 0 reinstalled, 0 newly installed, 0 to remove, 0 not upgraded.
Done
macondo[~]$
Last edited by macondo on 29. Jun 2012, 14:43, edited 1 time in total.
Re: Can'tedit anything-Sudoers file?
Don't ever ever do that. The sudoers file should only be edited using the visudo command.macondo wrote:Now you're ROOT and can edit the /etc/sudoers file:Code: Select all
# nano /etc/sudoers edit, adding the line you want to the file. save/exit
Re: Can'tedit anything-Sudoers file?
Noted.gapan wrote: Don't ever ever do that. The sudoers file should only be edited using the visudo command.
Explain this to me please? Is there a difference between vi/vim and nano? Or maybe there is another reason dealing with security? I'm curious.
Re: Can'tedit anything-Sudoers file?
gapan: i went to the polishlinux link and got this:
Code: Select all
Instead, use the visudo command:
# visudo
This protects from conflicts (when two admins edit this file at the same time) and guarantees that the right syntax is used (the permission bits are correct).
Re: Can'tedit anything-Sudoers file?
I did man visudo, i gotcha!
OK, because nano is my export editor in my .bashrc, when i visudo as root, the editor is nano (i hate vim).
Thanks gapan, another thing learned today
OK, because nano is my export editor in my .bashrc, when i visudo as root, the editor is nano (i hate vim).
Thanks gapan, another thing learned today

- Tim CowChip
- Posts: 304
- Joined: 27. May 2011, 03:35
- Location: Cascade Locks, OR
Re: Can'tedit anything-Sudoers file?
Just remember press the "Ins" key to edit then "Esc" to
"write"
and
"quit"
and vi can be as easy as nano.
Code: Select all
:w
and
Code: Select all
:q
and vi can be as easy as nano.