-
Notifications
You must be signed in to change notification settings - Fork 1
setupusers
In Linux systems, file and folder access is defined for certain users and groups of users. Naturally, each group can have multiple users and each user can be member of many groups.
https://wiki.archlinux.org/index.php/Users_and_Groups http://www.cyberciti.biz/faq/howto-linux-add-user-to-group/
-
showing the current users groups
schneider@kefi118:~$ groups schneider adm sudo lpadmin sambashare sftpusers -
showing [user]s groups
$ groups [user] -
showing the existing groups on the computer
$ cat /etc/group -
showing the permissions of the files in a folder
$ ls -l
-
creating a user
$ sudo useradd -m -g [initial_group] -G [additional_groups] -s [login_shell] [username]
While -m creates an own user home directory, -g specifies the primary group, -G specifies secondary groups, -s defines the default shell for this user, by default this is bash. To add a new user, say a master student called mats, to the workstation, providing him with an empty home directory and adding him only to his own group, also called mats, you have to type:
$ sudo useradd -m mats -s /bin/bash
-
change or set a password for the new user
$ sudo passwd mats -
add a user to a group
$ sudo usermod -a -G [group] [user] -
remove a user
$ sudo deluser --remove-home [user]removes the user and his home directory. you will be reminded that the group of the user remains without members. So also delete the group:
$ sudo delgroup [user]
-
check which users are existing
cut -d: -f1 /etc/passwd -
see login attempts
sudo less /var/log/auth.log
It is possible that a botnet tries to break into the workstation, which you recognise by secondly failed logins. The probability that the hack cracks the barrier is marginal, since only login via SSH with private-public key authentication is enabled.
Biodicée Docs by Sonia Kéfi & Vincent Devictor et al. is licensed under a Creative Commons Attribution 4.0 International License.
