You are not logged in.

#1 2011-04-29 20:46:32

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

sshd_config to use passwords for LAN IPs and keys for all others

Is this possible?  I want to force auth to use passwords for IPs in my LAN (192.168.0.*) but for all other IPs, I want it to use keys and no passwords.

Offline

#2 2011-04-30 00:15:13

hexanol
Member
From: Canaduh
Registered: 2009-08-04
Posts: 95

Re: sshd_config to use passwords for LAN IPs and keys for all others

Yes it's possible, something that would looks like this:

# by default, allow pubkey auth and deny password auth
PasswordAuthentication no
PubkeyAuthentication yes

Match Address 192.168.0.0/24
    # if requets comes from LAN, allow  password auth and deny pubkey auth
    PasswordAuthentication yes
    PubkeyAuthentication no

See man page (sshd_config) for more details.

Offline

Board footer

Powered by FluxBB