2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-09-11 12:06:24 +00:00
Files
xcat-core/xCAT/postscripts
Vinícius Ferrão 005a32a721 fix(sudoer): take the password from the passwd table
The sudoer postscript created the xcat account with the fixed password
rootpw. The rebased change from #6166 moved the password to the -p
option, which shows it in ps on the node and spreads it over
postscripts attributes.

The postscript now asks the management node for the password field of
the passwd row key=system,username=<sudoer> over getcredentials, the
way remoteshell gets the root hash under secureroot, and applies it:
the hash, or "!" when the table has no password for the account. sudo
and the SSH key are granted only after that. A missing reply, a refused
request, or a failed usermod fails the postscript and leaves the
account unprivileged. -u still selects the user name and defaults to
xcat. -p is rejected.

An existing login account is kept, with the other keys in its
authorized_keys. Root, accounts outside UID_MIN..UID_MAX, and accounts
without a login shell are refused. The sudo rule lives in
/etc/sudoers.d/xcat-sudoer, which records its account: a rerun with
another name revokes the rule, the password, and the cluster key of the
previous account, and the lines the old postscript appended to
/etc/sudoers are moved out after visudo accepts the result. Every
privilege write is checked, and a failed run removes the managed rule.
Without sudoers.d the rule is appended once to /etc/sudoers.
2026-09-03 20:39:09 -03:00
..
2024-05-07 16:19:25 +02:00
2018-11-15 17:12:55 +08:00
2016-07-21 13:27:40 -04:00
2016-08-15 08:50:49 -04:00
2024-05-07 16:43:07 +02:00
2016-07-21 13:27:40 -04:00
2022-08-15 10:16:22 -04:00
2020-06-04 10:00:56 -04:00
2020-06-04 10:00:56 -04:00
2016-07-20 11:40:27 -04:00
2012-11-23 02:29:54 +00:00
2012-11-23 02:31:37 +00:00
2018-07-06 04:46:25 -04:00
2022-08-15 10:16:22 -04:00
2018-11-15 17:12:55 +08:00
2018-11-15 17:12:55 +08:00
2018-11-15 17:12:55 +08:00
2023-02-28 15:43:03 -05:00
2018-11-15 17:12:55 +08:00
2022-08-15 10:16:22 -04:00
2018-11-15 17:12:55 +08:00
2014-11-04 21:43:02 -05:00
2016-07-21 13:27:40 -04:00
2016-07-21 13:27:40 -04:00
2018-11-15 17:12:55 +08:00