Second password for SSH-only access

passwordSecurityssh

TL;DR: I want to have a simple password to unlock my computer with physical access and a complex password to connect over ssh. This, using the same account.

I'm looking for a solution to manage access to my computer. For someone who has physical access to my computer (like myself and a couple of my friends who will use it every once in a while), I would like to have simple and short password that keeps complete strangers out. However, I would like to have another complex password for the SSH server, because the SSH server will be available from the public internet from time to time and having a simple password would be to much of a security risk.

I have looked into passwordless authentication using ssh keys, but that's not what I'm looking for, because I want to be able to ssh into my computer from any device. (And as far as I understand, my computer should have a list of trusted ssh-keys.)

So ideally, I want to have a simple password to unlock my computer with physical access and a complex password to connect over ssh.

Best Answer

I think the real solution is to create a non-admin account which can be accessed via ssh (presumably the account you want to use via physical access will have sudo privileges). The ssh account should not really have anything or be able to do anything other than let a user log in. You can then sufrom that user to the actual account you want to use, which will give you an additional layer of security and better logging regarding who is accessing the system (or trying to)