On a server I have a public key auth only for root account. Is there any point of logging in with a different account?
- Swiss cheese slices: make them holes too tight.
- When you run everything as root, if you fuck your shit, your shit’s fucked.
“Best practices” tend to come from other people’s whoopsies. But it’s always good to question things, too.
Its a concept called defense in depth. Without root login now you require the key AND sudo password.
Also, outside of self hosted you will have multiple people logging in. You want them to log in with their own users for logging and permission management.
Doesn’t even have to be the key necessarily. Could get in via some exploit first. Either way taking over the machine became a 2-step process.
deleted by creator
That server’s root access is now vulnerable to a compromise of the systems that have the private key.
Only the server should have the private key. Why would other systems have the private key?
The client has the private key, the server has the corresponding public key in its authorized keys file.
The server is vulnerable to the private key getting stolen from the client.
deleted by creator
Finding an exploit in ssh is worth more than whatever your server has to offer though.
deleted by creator