You are not logged in.
Hey guys,
I'm coming from Debian.
The strangest thing to me in Arch is that /sbin is just a symbolic link to /bin. As a regular user i can execute commands such as ifconfig, blkid, useradd, userdel etc. (although i cannot actually create or delete a user, just run the command).
Is there something wrong with my installation, or this is normal is Arch?
Isn't this a security risk? If not, why not?
I'd really appreciate if someone could explain the reason behind this.
Thank you in advance.
Last edited by earthw0rmjim (2017-04-02 11:38:06)
Offline
As far as I an recall it was done in order to simplify the directory structure and be in line with recommendations for using systemd. As you point out you cannot actually modify or create a user as the binaries in question are read only for non privileged users, this is why it's not a security risk.
There is nothing wrong with your install.
edit:
Just did a quick search:
https://www.archlinux.org/news/binaries … ervention/
https://www.freedesktop.org/wiki/Softwa … eUsrMerge/
Last edited by loafer (2017-04-02 06:44:26)
All men have stood for freedom...
For freedom is the man that will turn the world upside down.
Gerrard Winstanley.
Offline
http://fedoraproject.org/wiki/Features/UsrMove
Also notice that the path has had provided really *no* access restriction - it's just whether it was in your $PATH or not - you could have /sbin/foo as long as you had suffient rights on the file and you still cannot /usr/bin/bar if you lack them.
Offline
I'm coming from Debian.
...
As a regular user i can execute commands such as ifconfig, blkid, useradd, userdel etc. (although i cannot actually create or delete a user, just run the command).
That's to be expected isn't it? Under debian, you can't call useradd? On Arch it should end in a PAM failure.
Offline
Hey guys,
I'm coming from Debian.
The strangest thing to me in Arch is that /sbin is just a symbolic link to /bin. As a regular user i can execute commands such as ifconfig, blkid, useradd, userdel etc. (although i cannot actually create or delete a user, just run the command).Is there something wrong with my installation, or this is normal is Arch?
Isn't this a security risk? If not, why not?I'd really appreciate if someone could explain the reason behind this.
Thank you in advance.
nothing stops you from running them on debian
because it makes no sense to separate them these days since most of them have perfectly legal usage by unprivileged users too.
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
As a regular user i can execute commands such as ifconfig, blkid, useradd, userdel etc. (although i cannot actually create or delete a user, just run the command).
You can in Debian, too. By running e.g.:
/sbin/ifconfigThe separation of /usr/sbin vs /usr/bin vs /bin vs /sbin was a historical PITA, which just caused tedious $PATH mistakes and cross-distro incompatibility.
Last edited by brebs (2017-04-02 11:28:16)
Offline
Thanks for all the answers.
Offline
2 types of commands were mentioned:
* ifconfig, which users might want to run because it can show useful info.
* adduser, which non-root users *cannot* usefully run, and are only runnable by non-root users because distro packagers are lazy (and maybe leaving the door open to weird, custom permission setups).
Offline
$ useradd -h
Usage: useradd [options] LOGIN
useradd -D
useradd -D [options]
Options:
-b, --base-dir BASE_DIR base directory for the home directory of the
new account
-c, --comment COMMENT GECOS field of the new account
-d, --home-dir HOME_DIR home directory of the new account
-D, --defaults print or change default useradd configuration
-e, --expiredate EXPIRE_DATE expiration date of the new account
-f, --inactive INACTIVE password inactivity period of the new account
-g, --gid GROUP name or ID of the primary group of the new
account
-G, --groups GROUPS list of supplementary groups of the new
account
-h, --help display this help message and exit
-k, --skel SKEL_DIR use this alternative skeleton directory
-K, --key KEY=VALUE override /etc/login.defs defaults
-l, --no-log-init do not add the user to the lastlog and
faillog databases
-m, --create-home create the user's home directory
-M, --no-create-home do not create the user's home directory
-N, --no-user-group do not create a group with the same name as
the user
-o, --non-unique allow to create users with duplicate
(non-unique) UID
-p, --password PASSWORD encrypted password of the new account
-r, --system create a system account
-R, --root CHROOT_DIR directory to chroot into
-s, --shell SHELL login shell of the new account
-u, --uid UID user ID of the new account
-U, --user-group create a group with the same name as the user
$Looks like a succesful run as user to me ..
(adduser doesn't exist anymore on arch linux, useradd does)
P.S. yes, i know that's nitpicking
P.P.S.
Distro packagers were/are not the only lazy ones.
upstream devs put root-only commands in /sbin , later added options useful for normal users but didn't move the command.
Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.
clean chroot building not flexible enough ?
Try clean chroot manager by graysky
Offline