#ssh configuration

3 messages · Page 1 of 1 (latest)

agile bough
#

can i set up my ssh server in a way that from a local network i could access root and would be able to log in with passwords, while from outside network i wouldn't be able to access root and i would need to use keys

tranquil nimbus
#

In /etc/ssh/sshd_config you can add a rule to only allow connections from a specific IP/hostname or a range of IPs like so:

# Replace 0.0.0.0 with the IP
AllowUsers [email protected]

# You can use *(wildcard) to make the same rule apply to all users
AllowUsers *@0.0.0.0

make sure to restart your ssh daemon for the config change to take effect. it's also a good idea to have some sort of backup you can roll back to before changing ssh settings in case things go wrong

agile bough