ansible: 服务器初始化时显式开启 ssh 公钥认证
This commit is contained in:
@@ -80,6 +80,13 @@
|
||||
line: "PasswordAuthentication no"
|
||||
notify: restart ssh
|
||||
|
||||
- name: 开启公钥认证
|
||||
lineinfile:
|
||||
path: /etc/ssh/sshd_config
|
||||
regexp: "^#?PubkeyAuthentication"
|
||||
line: "PubkeyAuthentication yes"
|
||||
notify: restart ssh
|
||||
|
||||
|
||||
handlers:
|
||||
- name: restart ssh
|
||||
|
||||
Reference in New Issue
Block a user