Configuring OpenSSH VPS Server on Linux OS

OpenSSH server on VPS is the first and main method of access to Linux and FreeBSD server; by default, it is configured quite securely and allows all users to connect to the this system.

In the Debian distribution, the root user can only connect using the keys and cannot connect using the password. The configuration file itself may contain settings that may be useful to you depending on the situation. Keys DennyUsers and AllowUsers – Allows you to restrict users and IP from which they can connect. For example, these lines:

DennyUsers login
AllowUsers "root@,johnn,anny@"

Only root, johnn, anny users can connect. In addition, the root user can only connect with IP and anyy from the subnet.

Key Match – Let’s redefine some settings and global restrictions for connections that fall under the filter.

For example:

PasswordAuthentication no
PermitRootLogin no
Match Address, Host
PasswordAuthentication Yes
PermitRootLogin yes

For connections from addresses, and from the node will allow you to use a password

X11Forwarding no
Match User John Address 172.16.1.*
X11Forwarding yes

Was this article helpful?

Related Articles

Leave A Comment?