OpenSSH: 接続元によって認証方式を変える方法
Submitted by nasuno on 2007, June 1 - 4:12pm.
version 4.6p1 のマニュアルによれば、今のところ Match 指定は User, Group, Host, Address に対して以下の設定項目に適用できるようです。
Tagged: ssh
sshd_config の Match 指定を使うことで、いくつかの設定を選択的に上書きすることが可能になっています。
OpenSSH 4.6 以降では PasswordAuthentication に適用することができたので、接続元ネットワークにより認証方式を切り替える動作を試してみました。
# 外部ネットワークからの接続には公開鍵認証のみを有効とする
PasswordAuthentication no
# 内部ネットワークからの接続に限りパスワード認証を許可する
Match Address 192.168.1.*
PasswordAuthentication yes
sshd_configの例
- AllowTcpForwarding
- Banner
- ForceCommand
- GatewayPorts
- GSSApiAuthentication
- KbdInteractiveAuthentication
- KerberosAuthentication
- PasswordAuthentication
- PermitOpen
- RhostsRSAAuthentication
- RSAAuthentication
- X11DisplayOffset
- X11Forwarding
- X11UseLocalHost