Score:0

login to server only via SSH (disallow all other users / groups to login)

ph flag

I am willing to rent a server from a hosting provider. I will SSH to that machine. I do not want anyone else (specially those who has physical access to the machine) to login. I only want to permit to login via the SSH and with only my login and password or ssh key.

In other words, I want to disable regular login (which I am currently doing with my desktop, giving login and password via keyboard to login) and only allow SSH login.

P.S. I know if anyone has physical access, they can boot a Rescue CD and bypass any credentials. I also know there is cold boot attack. However, this question is about only allowing SSH login.

user535733 avatar
cn flag
Is this REALLY a full server machine located on somebody else's site? Or is this "server" merely a container or VM running on somebody else's machine?
blueray avatar
ph flag
I am planning to rent a complete server (not VM).
hr flag
Generally, only user accounts that you create, plus the `root` account, will have valid login shells - and in Ubuntu, the `root` password will be locked by default, preventing local logins as root.
blueray avatar
ph flag
@steeldriver is there any way I can disallow everyone to enter via "valid login shells" and only via "ssh"
hr flag
What do you men by "everybody"? AFAIK the only accounts that need login shells are your own and root's. Both will need valid login shells. The root account's password can (and should) be locked (according to Ubuntu best practices). Your own account password may also be locked provided you have set up key-based SSH authentication **however** that would prevent you from authenticating to `sudo`, so you'd need to also permit direct SSH access for root via key-based auth in order to perform administrative tasks.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.