mirror of
https://github.com/bohanyang/debi.git
synced 2026-09-27 06:26:15 +00:00
Update
This commit is contained in:
@@ -283,7 +283,7 @@ EOF
|
|||||||
|
|
||||||
if [ -n "$authorized_keys_url" ]; then
|
if [ -n "$authorized_keys_url" ]; then
|
||||||
backup /etc/ssh/sshd_config
|
backup /etc/ssh/sshd_config
|
||||||
run_later 'sed -Ei "s/^#?PasswordAuthentication .+/PasswordAuthentication no/" /etc/ssh/sshd_config'
|
run_later 'sed -Ei "s/^#?PasswordAuthentication.*/PasswordAuthentication no/" /etc/ssh/sshd_config'
|
||||||
$save_preseed << EOF
|
$save_preseed << EOF
|
||||||
d-i network-console/password-disabled boolean true
|
d-i network-console/password-disabled boolean true
|
||||||
d-i network-console/authorized_keys_url string $authorized_keys_url
|
d-i network-console/authorized_keys_url string $authorized_keys_url
|
||||||
@@ -342,7 +342,7 @@ EOF
|
|||||||
if [ "$username" = root ]; then
|
if [ "$username" = root ]; then
|
||||||
if [ -z "$authorized_keys_url" ]; then
|
if [ -z "$authorized_keys_url" ]; then
|
||||||
backup /etc/ssh/sshd_config
|
backup /etc/ssh/sshd_config
|
||||||
run_later 'sed -Ei "s/^#?PermitRootLogin .+/PermitRootLogin yes/" /etc/ssh/sshd_config'
|
run_later 'sed -Ei "s/^#?PermitRootLogin.*/PermitRootLogin yes/" /etc/ssh/sshd_config'
|
||||||
else
|
else
|
||||||
run_later "mkdir -m 0700 -p ~root/.ssh && busybox wget -O - \"$authorized_keys_url\" >> ~root/.ssh/authorized_keys"
|
run_later "mkdir -m 0700 -p ~root/.ssh && busybox wget -O - \"$authorized_keys_url\" >> ~root/.ssh/authorized_keys"
|
||||||
fi
|
fi
|
||||||
@@ -362,7 +362,7 @@ EOF
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
backup /etc/ssh/sshd_config
|
backup /etc/ssh/sshd_config
|
||||||
run_later 'sed -Ei "s/^#?PermitRootLogin .+/PermitRootLogin no/" /etc/ssh/sshd_config'
|
run_later 'sed -Ei "s/^#?PermitRootLogin.*/PermitRootLogin no/" /etc/ssh/sshd_config'
|
||||||
|
|
||||||
if [ -n "$authorized_keys_url" ]; then
|
if [ -n "$authorized_keys_url" ]; then
|
||||||
run_later "sudo -u $username mkdir -m 0700 -p ~$username/.ssh && busybox wget -O - \"$authorized_keys_url\" | sudo -u $username tee -a ~$username/.ssh/authorized_keys"
|
run_later "sudo -u $username mkdir -m 0700 -p ~$username/.ssh && busybox wget -O - \"$authorized_keys_url\" | sudo -u $username tee -a ~$username/.ssh/authorized_keys"
|
||||||
|
|||||||
Reference in New Issue
Block a user