[SOLVED] what is a quick way to get all of files needed for adduser to put it on void linux?
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I know Slack got this and maybe it was Slack that came up with adduser over useradd. Anyways... anyone knows what address I got a pull from, or wget it?
I do not think that is even the right one now that I look at it. always getting the two confused. the short order form one.
PS: generally, if you look at a C program inside a software tree, chances are that the "personal" headers (those not listed between < >) are elsewhere in the same tree
So just download the whole tree and at its root type:
find -name <header name>.
But that's assuming that for some reason you want to cherry pick a program to build just that, instead of building the whole software.
Last edited by Didier Spaier; 12-14-2018 at 03:34 PM.
Reason: PS added.
The VOID Linux is not a Slackware derivative, so far I know. It was written from scratch, so what's the connection with Slackware?
debian has a version but there do not have what I'd call source code, it is gibberish to me what they have. and I think I got a copy of it on manjaro now that I think about it, and it was taken from slackware, I think it even mentions it, and when I used it, it is exacly like slackwares, because they did not even mod it to match there system. maybe I should go see if I can find what or where they down load it from.
I got 4 distros install so I jump around a lot and its hard to remember what I got where some times, for some things.
PS: generally, if you look at a C program inside a software tree, chances are that the "personal" headers (those not listed between < >) are elsewhere in the same tree
So just download the whole tree and at its root type:
find -name <header name>.
But that's assuming that for some reason you want to cherry pick a program to build just that, instead of building the whole software.
I was query'ing for adduser let me check shadow ...
-----------
Arch Linux swiped a copy from slackware
Quote:
Git Clone URL: https://aur.archlinux.org/adduser.git (read-only)
Package Base: adduser
Description: Interactive front end to /usr/bin/useradd from Slackware Linux
let me git clone that and try to get it to work.
it is just a build package script, time to play.
I don't know how Void packaging works, but for sure the build script I linked to installs useradd as I see in the postinstall() function:
Code:
# Install our pam files not the ones supplied with shadow.
rm -f ${DESTDIR}/etc/pam.d/*
for f in chage passwd; do
install -m644 ${FILESDIR}/${f}.pam ${DESTDIR}/etc/pam.d/${f}
done
for f in chpasswd chgpasswd groupadd groupdel groupmems \
groupmod newusers useradd userdel usermod; do
install -m644 $DESTDIR/etc/pam.d/chage $DESTDIR/etc/pam.d/${f}
done
install -m644 ${FILESDIR}/login.defs ${DESTDIR}/etc
So, just run this script to build a package and be happy.
Looking at the top of the file, it was originally developed for Slackware by Hrvoje Dogan back in 1995. Then in 2002, Stuart Winter, aka drmozes, took that script as the inspiration for the modern adduser script and it has been tweaked from there by both Stuart and Pat over the years to what it is now (with a changelog documenting those tweaks at the top of the script).
The script will eventually run the useradd binary from shadow to generate the account on the system and assign it the various settings, including groups.
Looking at the top of the file, it was originally developed for Slackware by Hrvoje Dogan back in 1995. Then in 2002, Stuart Winter, aka drmozes, took that script as the inspiration for the modern adduser script and it has been tweaked from there by both Stuart and Pat over the years to what it is now (with a changelog documenting those tweaks at the top of the script).
The script will eventually run the useradd binary from shadow to generate the account on the system and assign it the various settings, including groups.
yeah I see it is looks rather easy. I copied slackwares, and moded the defualt groups to add user to, and ran it not as root, in my home directory, of course it could not access
Code:
Creating new account...
Password:
useradd: cannot open /etc/passwd
useradd: failed to unlock /etc/passwd
- Error running useradd command -- account not created!
(cmd: /usr/sbin/useradd -d /home/bob -m -g users -G audio,cdrom,floppy,input,lp,scanner,video -s /bin/bash bob)
but for arch linux pgkbuild and in voids that is for useradd not adduser it references a
I don't know how Void packaging works, but for sure the build script I linked to installs useradd as I see in the postinstall() function:
Code:
# Install our pam files not the ones supplied with shadow.
rm -f ${DESTDIR}/etc/pam.d/*
for f in chage passwd; do
install -m644 ${FILESDIR}/${f}.pam ${DESTDIR}/etc/pam.d/${f}
done
for f in chpasswd chgpasswd groupadd groupdel groupmems \
groupmod newusers useradd userdel usermod; do
install -m644 $DESTDIR/etc/pam.d/chage $DESTDIR/etc/pam.d/${f}
done
install -m644 ${FILESDIR}/login.defs ${DESTDIR}/etc
So, just run this script to build a package and be happy.
I attach it to this post for your convenience.
Sorry I can't help you more.
Cheers,
thanks for all of the pointing out stuff BUT this is for useradd which is not adduser, adduser uses useradd after it grathers information, making it a bit better to use. though I do wonder if I got add it to pam like void's script kist change the names for the program it is processing. because there is two different ones.
Code:
Manpage for useradd says: useradd is a low level utility for adding users. On Debian, administrators should
usually use adduser(8) instead. adduser : add user with full profile and info (pass, quota, permission, etc.)
two different ones, one uses the other one. the one VOID has it the other one, the backend one.
I am starting to figure that out. thanks! maybe hack VOID's build script for useradd. and use it for adduser.
what is worst case scenario if I screw this up?
I really don't know. But (not requested advice, I know): considering that basically adduser is mostly a front-end for useradd, maybe your time would be better invested just getting acquainted with useradd and friends like usemod? It has a good man pages, with links to other utilities at the bottom.
I really don't know. But (not requested advice, I know): considering that basically adduser is mostly a front-end for useradd, maybe your time would be better invested just getting acquainted with useradd and friends like usemod? It has a good man pages, with links to other utilities at the bottom.
yeaaaahhhhh but I am sooo comfortable with slackware adduser. then having to remember useradd -g -m ... as adding users is not a daily task other then me when I am adding a user to mess around to try things out from time to time then delete same said user.
all of the other ones I do not have much issues with . moduser or is it usermod, and chown etc..
all this script does it gather information then calls useradd and hands it over to it.
Code:
# Add the account to the system
CMD="$useradd "$HME" -m "$EXP" "$U_ID" "$GID" "$AGID" "$SHL" "$LOGIN""
$CMD
I do think all I'd really have to do is add that script to sbin and volia done. maybe do that LICENSE thing, but the pam is already set up for useradd so that is taken care of.
Code:
userx@voided.org:~/Documents
$ sudo ./adduser
Login name for new user []: bob
User ID ('UID') [ defaults to next available ]:
Initial group [ users ]:
Additional UNIX groups:
Users can belong to additional UNIX groups on the system.
For local users using graphical desktop login managers such
as XDM/KDM, users may need to be members of additional groups
to access the full functionality of removable media devices.
* Security implications *
Please be aware that by adding users to additional groups may
potentially give access to the removable media of other users.
If you are creating a new user for remote shell access only,
users do not need to belong to any additional groups as standard,
so you may press ENTER at the next prompt.
Press ENTER to continue without adding any additional groups
Or press the UP arrow key to add/select/edit additional groups
: audio cdrom floppy input lp scanner video wheel
Home directory [ /home/bob ]
Shell [ /bin/bash ]
Expiry date (YYYY-MM-DD) []:
New account will be created as follows:
---------------------------------------
Login name.......: bob
UID..............: [ Next available ]
Initial group....: users
Additional groups: audio,cdrom,floppy,input,lp,scanner,video,wheel
Home directory...: /home/bob
Shell............: /bin/bash
Expiry date......: [ Never ]
This is it... if you want to bail out, hit Control-C. Otherwise, press
ENTER to go ahead and make the account.
Creating new account...
Changing finger information for bob.
Name []: booy
Office []:
Office Phone []:
Home Phone []:
Finger information changed.
New password:
Retype new password:
passwd: password updated successfully
Account setup complete.
$ su bob
Password:
[bob@voided Documents]$ whoami
bob
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.