https://avatars.githubusercontent.com/u/103393591

给机房的Ubuntu22.04的Linux安装SSH的server

废话少说 1 sed -i 's/.*precedence ::ffff:0:0\/96.*/precedence ::ffff:0:0\/96 100/g' /etc/gai.conf 1 2 3 4 apt update apt install openssh-server -y systemctl enable --now ssh systemctl status ssh 1 2 3 4 5 6 7 8 9 sed -i 's/^#\?Port.*/Port 22/g' /etc/ssh/sshd_config sed -i 's/^#\?PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config sed -i 's/^#\?PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config sed -i 's/#ListenAddress 0.0.0.0/ListenAddress 0.0.0.0/' /etc/ssh/sshd_config sed -i 's/#ListenAddress ::/ListenAddress ::/' /etc/ssh/sshd_config sed -i 's/#AddressFamily any/AddressFamily any/'