# Sudo commands inside a secure ssh session: Is a complex password enough? — retained record

> Retained reddit record from reddit:homelab.

Canonical: https://highsignal.app/data/records/f029f5efebd7aca2

[← sources](https://highsignal.app/data)


source: [reddit](https://highsignal.app/data/reddit) (reddit:homelab)  published 2026-10-22 18:50 ingested 2026-10-23 02:41

[original source ↗](https://www.reddit.com/r/homelab/comments/1xcr7ke/sudo_commands_inside_a_secure_ssh_session_is_a/)

## retained text



```
Hey!

I got a question regarding password-only sudo commands inside ssh sessions. Here's my setup:

I connect to my debian server via ssh using an ed25519-sk key. I have to touch my yubikey's "button" and provide a password to get the ssh session. There's only one computer in the management vlan allowed in the firewall rules for ssh, and i can just plug a keyboard+monitor to the server as a fallback. SSH root login and password login are disabled and only one user can connect via ssh.  My SSH setup is pretty safe i think as it is not exposed to the web and only accessible to one local computer. This is a home server and i don't see a scenario where someone could enter my house and access everything by stealing my yubikeys for example.

Right now i have this very good and complex password for my only normal debian user, and i use that password in the ssh session to do administrative (sudo) tasks such as updating the OS, maintaining my docker containers (docker compose), etc.

Here's my question, assuming the server's services don't get exploited: If the server is only accessible locally (keyboard+monitor or ssh) is it good enough to have only a strong password for the debian user's sudo commands, or do i need to setup something like totp on sudo commands using something like Google Authenticator PAM module or pam\_oath? I use keepassxc to store that user's password. The keepassxc database also requires a password and a touch on my yubikey.

edit: i can't seem to be able to use my yubikey on the management computer to do sudo commands on the server inside the ssh session. I have to plug the yubikey on the server and execute commands directly on it with keyboard+monitor. I found a sketchy tool to do pull it off a while ago, but i won't risk using it.

edit2: i have multiple yubikeys as backup
```



document fetched 2026-10-23 00:40 · canonical https://reddit.com/r/homelab/comments/1xcr7ke/sudo_commands_inside_a_secure_ssh_session_is_a
