/etc/passwd

From Linux Shell Scripting Tutorial - A Beginner's handbook
Jump to: navigation, search
  • /etc/passwd is the password file for Linux and UNIX like operating systems. /etc/passwd contains one line for each user account, with seven fields delimited by colons (":"). You can view this file with cat command:
cat /etc/passwd

Sample outputs:

root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
dnsproxy:x:133:140::/home/dnsproxy:/bin/false
sshproxy:x:134:141::/var/lib/sshproxy:/bin/false
ntp:x:135:142::/home/ntp:/bin/false
vivek:x:1000:1000:Vivek Gite,,,,:/home/vivek:/bin/bash
t2:x:1002:1001::/home/t2:/bin/bash

These fields are:

  1. Login name
  2. Optional encrypted password. It is now stored in /etc/shadow file.
  3. Numerical user ID
  4. Numerical group ID
  5. User name or comment field
  6. User home directory
  7. Optional user command interpreter

External Links

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox
Print/export