Score:0

Is it possible to limit SSH client users to connect ONLY if I manually type the key into the SSH Server?

in flag

So basically I want to get a more secure way to ssh into my server, because it is located in a very big LAN. I tried using firewall to only allow certain IP's into it, it works, but someone could manually change the IP to the one that is allowed un the UFW.

What I want is that if someone wants to log in the SSH I, as a server, will have to manually input the client's key into the server.

Nikita Kipriyanov avatar
za flag
What do you mean by "manually inputting"? Disable the ability to do automated key deployment with `ssh-copy-id`, disable the ability for the users to add/update their keys?
Score:1
ar flag

What I want is that if someone wants to log in the SSH I, as a server, will have to manually input the client's key into the server.

That's basically what key based authentication does.

You add a key (or multiple keys) per user that's allowed to connect. The keys are large cryptographic secrets, that's totally unfeasible to brute force. Someone without the key is unable to authenticate.

This is perfectly acceptable to servers exposed to the internet.

Score:0
cn flag

If you want to really control access disable password based logins and only allow access with a private key.

If you use a password protected private key that only you have access to then they will not be able to login no matter what IP address they use.

You can disable password based login by editing the /etc/ssh/sshd_config file and settings ChallengeResponseAuthentication, PasswordAuthentication and UsePAM to no (more details here). You should only do this one you have properly setup and tested using ssh keys to login so you don't lock yourself out of the machine.

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.