If a user has loginShell=/sbin/nologin
is it still possible to
ssh user@machine [command]
assuming that the user has proper ssh keys in its home directory that can be used to authenticate?
My goal is to keep the user as a nologin, but still able to execute commands on a few other machines on the network (similar to its use through 'sudo -u'), and am wondering if this is a reasonable course.
command
is run instead of the login shell./sbin/nologin
as a shell. If your concern is security of the account then disabling password auth and using ssh keys is sufficient./sbin/nologin
then user won't be able to login or execute commands on machine. cronjobs can be ran as user andsftp
can be configured to open sessions, but opening a shell via ssh won't happen