Fixed PasswordAuthentication
parent
be6ce918b2
commit
6372c8dc9b
10
manifest.jps
10
manifest.jps
|
@ -76,8 +76,14 @@ onInstall:
|
||||||
chmod +x /home/jelastic/add-sftp-user-addon/*.sh
|
chmod +x /home/jelastic/add-sftp-user-addon/*.sh
|
||||||
- cmd[cp]:
|
- cmd[cp]:
|
||||||
user: root
|
user: root
|
||||||
commands:
|
commands: |-
|
||||||
- echo -e "\nMatch User user*\nPasswordAuthentication yes" >> /etc/ssh/sshd_config
|
if grep -qE "^Match User user[0-9]*$" /etc/ssh/sshd_config; then
|
||||||
|
sed -i '/^Match User user[0-9]*/!b;n;c\ PasswordAuthentication yes' /etc/ssh/sshd_config
|
||||||
|
else
|
||||||
|
echo -e "\n# Added by SFTP addon\nMatch User user*\n\tPasswordAuthentication yes" >> /etc/ssh/sshd_config
|
||||||
|
fi
|
||||||
|
awk '!seen[$0]++' /etc/ssh/sshd_config > /etc/ssh/sshd_config.tmp && mv /etc/ssh/sshd_config.tmp /etc/ssh/sshd_config
|
||||||
|
systemctl restart sshd
|
||||||
- cmd[cp]:
|
- cmd[cp]:
|
||||||
user: root
|
user: root
|
||||||
commands:
|
commands:
|
||||||
|
|
Loading…
Reference in New Issue