Tag Info

Hot answers tagged

4

Listing out groups of users You can get a list of all your local users with this command: $ getent passwd | awk -F: '{print $1}' NOTE: getent will return local users assuming you do not have sssd (or some similar service running which pulls LDAP users in too) and your /etc/nsswitch.conf is restricted to files, i.e. it's not including things like NIS or ...


3

As root you can change any users password by using the "passwd" command followed by the username; passwd username This will then prompt you to enter the new password twice. To clarify there is no way to see an existing users password.


3

sudo command requires password of current user, not root user. If you wish to authorize by root password you can just use su -.


3

For a user someusername to be able to write in folder, that was initially made by root, you need to change the rwx permissions and/or the owner resp. group. If you restrict the permissions then someusername needs to be either owner or group member. If you do chmod 777 /somefolder, everyone can read and write, including someusername. If you do chmod 770 ...


2

Check command w: w displays information about the users currently on the machine, and their processes. The header shows, in this order, the current time, how long the system has been running, how many users are currently logged on, and the system load averages for the past 1, 5, and 15 minutes. The following entries are displayed for each ...


1

While Anthon's answer is technically correct, I'm writing this one to explain where Octal Permissions come from, and how to calculate them. Octal Permissions is one of the most important concepts in the *nix world. Why This Concept is Important Since the Birth of Unix Circa 1969 -1974 on a discarded DEC PDP-7 (see photo and history) and Linus Torvalds ...


1

You may want to write a script that will store the number of users currently logged in a file and the total users in another file and do a comm over them. For example: #!/bin/bash w | awk 'NR > 2 {print $1}' | sort > logged.txt #sorted list of logged users awk -F':' '{ print $1}' /etc/passwd | sort > allusers.txt #sorted list of all users comm ...


1

A better way to get local users might be to see if the user has a valid login shell: getent passwd | grep -f /etc/shells Here's something that should work: getent passwd | grep -f /etc/shells | tr ',' ':' | \ awk -F: '{print $1, $5}' | while read USER NAME do echo $NAME:$(chage -l $USER| awk -F': ' '/Password expires/{print $2}') ...


1

If you have root, try chsh --shell /bin/bash raoming where chsh : change shell --shell /bin/bash tel to use /bin/bash roaming : your user.


1

man 8 nologin There is your real answer as to why it isn't working. If you want the user to log in then you need to give them a shell like /bin/bash or something else. You can edit /etc/passwd directly or use usermod -s /bin/bash roaming, all of this needs to be done as root.


1

Changing the login shell does not necessarily prevent users from authenticating (except in some services that check if the user's shell is mentioned in /etc/shells). People may still be able to authenticate to the various services that your system provides to unix users, and may still be authorized to perform some actions albeit probably not run arbitrary ...


1

You can use chsh command: ~# chsh myuser Enter new shell details when requested: Login Shell [/bin/sh]: /bin/nologin Or shorter version: ~# chsh myuser -s /bin/nologin



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