Tag Info

Hot answers tagged

4

You can parse the passwd database using awk. In the passwd format, each entry is a list of fields delimited by :, with the first field being the username and the third field being the UID. So, in awk, you could do: getent passwd | awk -F: '$3 > 10 {print $1}'


3

I personally like to use just: ls /home Admittedly this is not a list of users but instead a list of their home directories. Currently existing human users on the system will have home directories in /home, but you may see the home directories of past users who were removed, as well. This works for my purposes and may work for yours as well. For example, ...


2

While it might seem like a clear-cut idea, actually there is ambiguity in the meaning of human user. Is a user account deliberately hidden from the login screen because it's used only for specialized purposes (but by humans) a human user? How about the ubuntu user (UID 999) on the live CD? And guest accounts in Ubuntu are created on-the-fly and destroyed ...


2

TL;DR: In ~/.config, rename libreoffice to libreoffice.old. Often a bug or other problem that keeps a big, complicated application (like LibreOffice or Firefox) from starting correctly is triggered by something in the profile of the user who runs it, that is, in user-specific configuration files. When this happens, you can rename the folder that contains ...


2

Since you're an experienced user, I suggest you pam_time: The pam_time PAM module does not authenticate the user, but instead it restricts access to a system and or specific applications at various times of the day and on specific days or over various terminal lines. This module can be configured to deny access to (individual) users based on ...


2

Here is the improved version of my original script I've linked in the comments. This script uses all the tools that come with ubuntu, namely at(for task scheduling) , date, and gnome-session-quit so no additional installation of software is necessary. This script can be called from ~/.config/autostart or /etc/xdg/autostart in a .desktop file. date will ...


2

SOLUTION 1 : You can use: #!/bin/bash while IFS= read -r line; do [[ "$(cut -d: -f3 <<<"$line")" -gt 10 ]] && echo "$line" done </etc/passwd Considering you have no username containing :. If you just want the usernames: #!/bin/bash while IFS= read -r line; do [[ "$(cut -d: -f3 <<<"$line")" -gt 10 ]] && echo ...


2

Open the terminal and type: sudo newusers /tmp/userlist.txt In the userlist.txt file, each line should contain user data in the following syntax: username:password:User ID:Group ID:Comments:Userhome directory:User shell Since the userlist.txt file contains users' passwords, it should not be stored in a human readable form after you have ...


1

Using awk: awk -F: '{if ($3 > 10) { print $1 ":" $3 } }' /etc/passwd this will list all users with their associated UID where UID > 10. Thanks to @sadi note, to list only usernames awk -F: '{if ($3 > 10) {print $1}}' /etc/passwd


1

Here's one way to get the gid, uid, shell and directory: printf "Enter username: " read user groupid=$( id -g $user ) userid=$( id -u $user ) usershell=$( grep $user /etc/passwd | awk -F':' '{ print $7 }' ) userdirectory=$( grep $user /etc/passwd | awk -F':' '{ print $6 }' )


1

You can execute script with ./ if you are in same directory as script. But if you want to run it from anywhere , you have to put the script into one of the folders listed in your $PATH preferably /usr/bin or add a custom folder to the list. As for creating a file, if you specify full path to script , like nano /usr/bin/myscript.sh , yoi don't have to be ...


1

Maybe you can put this at the end of your script? read -p "$USER"


1

sudo apt-get install gnome-system-tools How to manage users and groups?


1

For the reason muru stated in his comment above, it is impossible to restrict some actions for administrator accounts. Even if you can achieve that the admin may not do this from within his/her own account, he/she still has the right to become root (sudo) and have no restrictions at all. Sorry, but the only thing to restrict an admin's rights is to convert ...


1

This should be governed by the org.freedesktop.accounts.change-own-user-data Polkit action: description: Change your own user data message: Authentication is required to change your own user data defaults: allow_active: yes allow_any: no allow_inactive: no You can set it by creating a .pkla file in ...


1

Are you trying to connect to a windows server or ubuntu/linux server? Generally, you can use ssh to log into a remote server (if an ssh server is running in remote host) by: ssh remote_username@remote_host


1

Joining the party, I oversee a network systems using LDAP, having home directories outside /home and UIDs (due to a scripting glitch) in the millions. None of the current answers, therefore, work. The test that works for me is checking whether the user has a valid login shell. A valid shell is one which is listed in /etc/shells. The simplest form: getent ...



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