Kaynağa Gözat

export ssh_port='22' SSH 端口可以修改

蘭雅sRGB 3 yıl önce
ebeveyn
işleme
5e6ced66fd
1 değiştirilmiş dosya ile 3 ekleme ve 1 silme
  1. 3 1
      auto.sh

+ 3 - 1
auto.sh

@@ -6,6 +6,7 @@
 ## Blog: https://moeclub.org
 ## Written By MoeClub.org
 
+export ssh_port='22'
 
 export tmpVER=''
 export tmpDIST=''
@@ -728,7 +729,8 @@ d-i finish-install/reboot_in_progress note
 d-i debian-installer/exit/reboot boolean true
 d-i preseed/late_command string	\
 sed -ri 's/^#?PermitRootLogin.*/PermitRootLogin yes/g' /target/etc/ssh/sshd_config; \
-sed -ri 's/^#?PasswordAuthentication.*/PasswordAuthentication yes/g' /target/etc/ssh/sshd_config;
+sed -ri 's/^#?PasswordAuthentication.*/PasswordAuthentication yes/g' /target/etc/ssh/sshd_config; \
+sed -ri 's/^#Port 22/Port ${ssh_port}/g' /target/etc/ssh/sshd_config;
 EOF
 
 [[ "$loaderMode" != "0" ]] && AutoNet='1'