SliTaz SliTaz Forum

You are not logged in.

#1 2018-02-12 04:45:10

black dog
Member
Registered: 2011-04-09
Posts: 331

How to configure sudo?

Hello!

How to configure sudo?

Slitaz-5.0 (flavor base).

Command [c]visudo[/c] does not work. Flie [c]sudoers[/c] was not found.

Offline

#2 2018-02-12 09:16:16

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: How to configure sudo?

Hi black dog,

Did you install the "sudo" package?

It has [c]/etc/sudoers[/c] and [c]/usr/sbin/visudo[/c] and many more files:

http://cook.slitaz.org/index.cgi?files=sudo

Offline

#3 2018-02-12 09:49:23

black dog
Member
Registered: 2011-04-09
Posts: 331

Re: How to configure sudo?

Thank you. I thought that I would have to install "sudo" package. I was a little embarrassed that the "sudo" command works in slitaz-5.0 by default.

Offline

#4 2018-02-12 12:47:18

black dog
Member
Registered: 2011-04-09
Posts: 331

Re: How to configure sudo?

[c]

root@slitaz:~# adduser -G sudo tux

adduser: user 'tux' in use

[/c]

Why?

Offline

#5 2018-02-12 22:47:06

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: How to configure sudo?

> I was a little embarrassed that the "sudo" command works in slitaz-5.0 by default.

It is not "sudo" command. It's a little fake that can only simulate "sudo" behavior in the next form:

[c]sudo <command> [<arguments>][/c]
It never ask you for your user password. It always use only root's password.

You can open the script [c]/usr/bin/sudo[/c] (until you not yet installed the real "sudo") in the text editor. Root's password is saved in your [c]$HOME/.config/slitaz/subox.conf[/c] file. It will ask you if it's not saved yet and then will save it to that file. That's all.

> adduser: user 'tux' in use

Check your [c]/etc/group[/c] file. Looks like user "tux" is already belongs to the "sudo" group:

[c]type:
    grep ^sudo /etc/group
result:
    sudo:x:101:tux[/c]

Offline

#6 2018-02-13 04:22:20

black dog
Member
Registered: 2011-04-09
Posts: 331

Re: How to configure sudo?

Something went wrong. sad

[c]grep sudo /etc/group
sudo:x:1000[/c]
I, of course, can edit the [c]/etc/group[/c] file, but I'd like to figure out why [c]adduser[/c] command does not work.

Offline

#7 2018-02-13 08:47:47

lexeii
Administrator
Registered: 2012-03-21
Posts: 1,853

Re: How to configure sudo?

Use the different command instead:

[c]addgroup --help
...
Add a group or add a user to a group
...

addgroup tux sudo[/c]
Looks like only this command will help you to add existing user to existing group although I'm not very sure… It works for me.

Offline

#8 2018-02-13 09:54:27

black dog
Member
Registered: 2011-04-09
Posts: 331

Re: How to configure sudo?

Thank you! Happened!

I tried earlier this command with the [c]-G[/c] option and got an error message. In the form of [c]adduser tux sudo[/c] the command worked and the tux user appeared in the sudo group.

PS

Only now I noticed that I used another command. smile

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 7 queries executed - Memory usage: 1.54 MiB (Peak: 1.77 MiB) ]