#!/bin/bash 2 d' g' D1 V" S) R9 O0 V9 H
#set root password sudo passwd root 5 k, _; i3 S* t8 \# U( I
#notes Document content sudo sed -i "s/.*root quiet_success$/#&/" /etc/pam.d/gdm-autologin sudo sed -i "s/.*root quiet_success$/#&/" /etc/pam.d/gdm-password
/ L9 r" c/ X: S3 k+ i. ?#modify profile sudo sed -i 's/^mesg.*/tty -s \&\& mesg n \|\| true/' /root/.profile ! C2 d! M# o2 w) c2 Q1 j4 j
#install openssh sudo apt install openssh-server
" Y4 `+ w4 j9 Q( q( T#delay sleep 1
& S% ~! c* E) G# l0 K1 K3 g) `! W4 C#modify conf sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
8 F) X6 J% m5 p, Y4 _. I$ o#restart server sudo systemctl restart ssh ) Q5 N! h% X' F0 H
*******************************************************************************************
) ]) X' A2 s: ^) r3 a4 p7 v3 r% L' x8 ?6 z$ {' ^
修改固定IP
! q, o5 F: V& h" B$ D4 c! ]3 d, t$ t. R x- w5 t& C' F( T
cd /etc/netplan/ sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.bak 6 r z; M5 S8 m. x
sudo apt update -y sudo apt install net-tools -y : x. Y3 S6 n6 U
nano 01-network-manager-all.yaml
1 C3 n: S% I+ mnetwork: renderer: NetworkManager ethernets: ens33: addresses: - 192.168.83.222/24 routes: - to: default via: 192.168.83.2 nameservers: addresses: - 192.168.83.2 - 114.114.114.114 version: 2
. u" V" J, ~( @ t, Zsudo netplan apply 5 s7 \, F$ v7 B$ I- f& u1 c; @
************************************************** |