Login and shell access
Unlike personal SRCF accounts, group accounts do not come with an “SRCF password”, which means you can’t authenticate as a group account over SSH or file transfer protocols. Groups are given a UNIX shell account but without a password or shell configured.
Instead, you should connect using your personal account, which will have write access to well-maintained files in group accounts where you’re listed as a group account admin.
Running commands
For ad-hoc commands that need to be run as the group’s user account, you can use sudo
:
sudo -u <groupname> <command> <args>...
-u <groupname>
part of the command above).
To use certain systemd commands like systemctl
or journalctl
, you’ll also need to override an environment variable in order for those to work correctly:
sudo -Hu <groupname> XDG_RUNTIME_DIR=/run/user/$(id -u <groupname>) <command> <args>...
You might like to add a function to your ~/.bashrc
to make this easier to remember:
asgroup () {
name=$1
shift
sudo -Hu $name XDG_RUNTIME_DIR=/run/user/$(id -u $name) "$@"
}
Usage:
asgroup <groupname> <command> <args>...
For long-running or background programs that should be always-on and restored on server reboot, see Scheduled tasks.
Last modified on Friday Dec 8, 2023 by Richard Allitt