Article ID: 114334, created on Jul 11, 2012, last review on Aug 12, 2014

  • Applies to:
  • Operations Automation

Name Service Switch (NSS) is common UNIX system facility. It is used to resolve names to IDs, e.g. to resolve user name to its ID. It is used in low level library calls/functions like getpw_*.

Every service (ProFTPd/Apache/SSH/other) calls these functions to resolve names (like user names/domain names/group names/etc.). Usually /etc/passwd is used for this purpose. In Linux Shared Hosting NG library is used (/lib/ on 32-bit or /lib64/ on 64-bit servers). NSS configuration is defined in the /etc/nsswitch.conf file (ng string in passwd and shadow entries):passwd:     files   ng
shadow:     files   ng

So, resolving of user/group names to IDs is implemented in a low-level library. Parallels NG Hosting NSS plugin gets information about users/groups (webspace owners) from Configuration Database via NG Caching Service instead of /etc/passwd. Information is stored in the v_apache_h2e_websites table on the Configuration Database servers. SSH access to customers' webspaces is also implemented using NSS plugin (v_apache_h2e_websites table in Configuration Database).

When one of the NG services (Apache/ProFTPd/SSH) makes a getpwnam call, NSS through the libnss_ng plug-in contacts shstg service (NG Caching Service) which either provides cached data back to NSS or makes a database request if requested data is absent in cache, thus this operation is transparent to the hosting services.

The SQL query like provided below may be used to fetch information about users in NG webspace: web_cluster_db74=> SELECT user_id, user_name, ftp_login, ftp_passwd, ftp_home_dir, ssh_login, ssh_passwd, ssh_home_dir, ssh_primary, ssh_enabled FROM v_apache_h2e_websites WHERE webspace_id=100062;
-[ RECORD 1 ]+----------------------------------
webspace_id  | 100062
user_id      | 100062
user_name    | o100062
ftp_login    | f100062
ftp_passwd   | $1$h2e-ftp$N2/bRpyqRXpxiVccuC9h5.
ftp_home_dir | /var/www/vhosts/1/100062
ssh_login    | nguser
ssh_passwd   | $1$h2e-ssh$9fvejRYllNy4zaoFaTSb40
ssh_home_dir |
ssh_primary  | t
ssh_enabled  | t

NSS Log: /var/log/h2e-nss.log.

More details about standard UNIX NSS facility may be found by the link

See the main Knowledgebase article #114326 Linux Shared Hosting NG: General Information, Best Practices and Troubleshooting for more information about NG Hosting in Parallels Automation.

caea8340e2d186a540518d08602aa065 5356b422f65bdad1c3e9edca5d74a1ae e12cea1d47a3125d335d68e6d4e15e07

Email subscription for changes to this article
Save as PDF