adduser claude
then follow the prompts
mkdir /home/claude/.ssh
touch /home/claude/.ssh/authorized_keys
chown claude:claude -R /home/claude/.ssh
chmod 700 /home/claude/.ssh
chmod 600 /home/claude/.ssh/authorized_keys
cat claude_ed25519.pub >> /home/claude/.ssh/authorized_keys
Or user nano and copy the contents of the pub file to authorized_keys.
Edit SSH config - add or change the following lines:
nano /etc/ssh/sshd_config
PubkeyAuthentication yes
# Expect .ssh/authorized_keys2 to be disregarded by default in future.
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
AllowUsers claude
Restart SSH service
systemctl daemon-reload
systemctl restart ssh
visudo
Add the following line
claude ALL=(root) NOPASSWD: /usr/bin/journalctl, /bin/systemctl status myapp