Request for the HPC team

Send this page when the cluster login nodes are not the machine that runs the nextPYP website. The helper is needed on the web host and on every host behind slurm.host. Compute nodes do not run it. slurmd already becomes the user who submitted the job.

What we need

nextPYP connects to the login node over SSH as its service account, then runs sbatch, squeue, and scancel as the person who owns the project. The service account may run one program, as members of one group, with no extra environment and no shell.

The service account. An account, nextpyp unless the site chose another name, that exists on the login nodes with the same UID as on the web host, has a shell that can run a command over SSH, and accepts the web host’s public key in its authorized_keys. The nextPYP administrator supplies that key (~nextpyp/.ssh/id_ed25519.pub on the web host).

Three files on every login node.

  • /usr/libexec/nextpyp/user-processor, mode 0755, owner root. The nextPYP administrator supplies the file and its SHA-256 from the release SHA256SUMS. user-processor --version prints user-processor 1.

  • The group named by the site: a local nextpyp-users, or a directory group the lab already controls.

  • /etc/sudoers.d/nextpyp, mode 0440, exactly:

    Defaults!/usr/libexec/nextpyp/user-processor !requiretty, !use_pty, env_reset
    nextpyp ALL=(%nextpyp-users) NOPASSWD: /usr/libexec/nextpyp/user-processor
    

    Replace nextpyp with the service account and nextpyp-users with the group. Check the file with visudo -cf /etc/sudoers.d/nextpyp before installing it.

A nextpyp-login package with the same three items is built with every release (nextpyp-login-<version>.rpm and nextpyp-login_<version>.deb in the same repositories as nextpyp). It hardcodes the names nextpyp and nextpyp-users and does not create the service account. Use it only when those names match your site. For other names, the command sudo nextpyp install-login-node --helper <file> --sha256 <hex> does the three steps above as root: it checks the helper’s checksum, installs it at /usr/libexec/nextpyp/user-processor, creates the group if it is missing, writes /etc/sudoers.d/nextpyp, and refuses the file if visudo -c rejects it. PYP_USER and PYP_USERS_GROUP in front of the command change the two names. Run without root, it stops and says so.

One file, if you accept a sudoers rule that names a path on the shared filesystem. Install only the drop-in, and point the path at <sharedExecDir>/user-processor. That path must be owned by root and must not be group- or world-writable. A helper the service account can replace lets it run anything as any member of the group, so root ownership is the one to use; nextPYP does not check that path for you. Many sites refuse this variant. The three-file install does not have the problem.

What the rule does not allow

One absolute program. One invoking account. One Runas group. NOPASSWD. No SETENV. No shell. The helper refuses uid 0, uids below UID_MIN, and a switch that did not happen. Job environment arrives only as --env NAME=VALUE arguments the helper checks.

The login-node interface is version 1: run, check, --expect-uid, --env, --quiet, and --version. A later nextPYP does not need this file reinstalled unless we publish a security fix.

If slurm.host is a round-robin name, install the files on every address. A single SSH can land on a node that has them while its sibling does not.

Removing it

Delete /etc/sudoers.d/nextpyp, the helper, and, if you created it, the local group. Shared data is not touched.

Group membership

Adding a person to a local nextpyp-users is gpasswd -a <user> nextpyp-users, run as root on each login node; gpasswd works for LDAP accounts in a local group. If the group is a directory group the lab already controls, membership is changed in that directory, not on the cluster, and no root ticket is needed per person.

Sudo records every invocation, including the arguments. --env values are in that log.