I have learned a lot today messing around with ssh with RSA and creating system user accounts with no password, no login etc etc. What I was trying to do was create a user with a home directory needed for ~/.ssh/ and a password (needed for initial ssh setup)
But I can't seem to get it set-up correctly.
I know about using
ssh-keygen
ssh-copy-id user@remotehost
This is simple for RSA
and I know how to create a user with say
useradd -r newuser
OR
adduser newuser --system --shell=/bin/false
passwd newuser
passwd -d newuser
The End Goal
is a user who doesn't have a shell, or atleast can't be logged into from a remote computer, but can still be used to ssh over to another computer and run a command. Is this even possible?
The REASON/GOAL
is to have a user whom when the ups runs low on power, shuts down the other connected computers via ssh before shutting down the main computer. (Only one computer can connect to the UPS via USB at a time to monitor the stats).
I don't want people to be able to log in via SSH with the username UPS, but I need ups to be able to ssh into remotehost without password.