Hot answers tagged

3

These folders are not made/used by the system during user creation because the system doesn't generate them. They are generated the package xdg-user-dirs-update (Ubuntu) and xdg-user-dirs (Fedora/RHEL). The file /usr/bin/xdg-user-dirs-update is run at logon and creates the files based on defaults in /etc/xdg/user-dirs.defaults, or if it exists $HOME/....


2

Lets say your file is named just file. This script will do the job: USERNAME=$(cat file | cut -d: -f1) echo "$USERNAME" ID=$(cat file | cut -d: -f2) echo "$ID" USER_SHELL=$(cat file | cut -d, -f2 | cut -d: -f2) echo "$USER_SHELL" useradd -m -s "$USER_SHELL" -u "$ID" "$USERNAME"


2

To give Tim access to iptables, you can edit /etc/sudoers, with visudo: tim ALL=NOPASSWD: /sbin/iptables This will allow him to used the iptables as root without inputing his password. The path is full, for security reasons, otherwise if only iptables as you have, Tim would be able run any binary called iptables as root, and would be enough to create a ...


1

This is a bare minimum script to get the job done. It makes sure that neither the username nor the uid is already in use. It makes a matching group for each user (with gid=uid) - it doesn't check if the gid or group name already exists (left as an exercise for the reader - hint: use getent group). Note: the script below is untested but I've written ...


1

"root" (aka "superuser") is the name of the system administrator account. The origins of the name are a little archaic, but that doesn't matter. Root user has user id 0 and nominally has unlimited privileges. Root can access any file, run any program, execute any system call, and modify any setting. (But see below┬╣). Prior to the invention of the "sudo" ...



Only top voted, non community-wiki answers of a minimum length are eligible