Q. I’m new to UNIX and we are using HP-UX and Solaris system here. What does a plus (+) or a minus (-) at the beginning of a line in the password (/etc/passwd) file signify?
A. The /etc/passwd file under UNIX/Linux operating system can have + or – minus symbol. The password file can contain entries beginning with a + (plus sign) or - (minus sign) to selectively incorporate entries from another naming service source, such as NIS, NIS+, or LDAP.
According to man page:
A line beginning with a plus (+) is used to incorporate entries from the Network Information System. There are three styles of + entries:
- + : Insert the entire contents of the Network Information System password file at that point;
- +name : Insert the entry (if any) for name from the Network Information System at that point
- +@name : Insert the entries for all members of the network group name at that point.
- If a + entry has a non-null password, directory, gecos, or shell field, they override what is contained in the Network Information System. The numerical user ID and group ID fields cannot be overridden.
The passwd file can also have lines beginning with a minus (-), which disallow entries from the Network Information System. There are two styles of - entries:
- -name : Disallow any subsequent entries (if any) for name.
- -@name : Disallow any subsequent entries for all members of the network group name.
- 30 Cool Open Source Software I Discovered in 2013
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012
- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop