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.

🐧 Get the latest tutorials on Linux, Open Source & DevOps via RSS feed or Weekly email newsletter.

🐧 0 comments... add one


CategoryList of Unix and Linux commands
Disk space analyzersdf duf ncdu pydf
File Managementcat cp mkdir tree
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Modern utilitiesbat exa
Network UtilitiesNetHogs dig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg glances gtop jobs killall kill pidof pstree pwdx time vtop
Searchingag grep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre> for code samples. Still have questions? Post it on our forum