↑ ↓ select, Enter open, Esc close

List user accounts with a login shell

user@server
awk -F: '$7 !~ /(nologin|false)$/ {print $1, $3, $6, $7}' /etc/passwd

Parses /etc/passwd and prints the username, UID, home directory and shell of every account that has a real login shell. Expected are root and your own admin accounts. On Plesk, system users of subscriptions that were granted SSH access also appear.

Note: An unknown account with /bin/bash is a warning sign. Accounts that come from LDAP or similar sources are not listed in this file.

Also searched as

  • list users who can log in linux
  • show users with bash shell
  • find accounts with shell access

Related one-liners

All in Security

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.