#!/bin/bash 7 N% T' h- N5 f6 M/ B( \: X
#set root password sudo passwd root
( [& D% _& F# ]! R3 \#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 % T, b6 ^; }; `$ E9 b7 z! _
#modify profile sudo sed -i 's/^mesg.*/tty -s \&\& mesg n \|\| true/' /root/.profile 6 O: K, t1 o1 ^8 ] d/ s) R# h0 {
#install openssh sudo apt install openssh-server 1 o: G X- C; \( x# l4 I7 V* G
#delay sleep 1
9 m' x7 M3 D& }, p" Y#modify conf sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config 9 X; m5 \& a; l, [3 \! H5 i
#restart server sudo systemctl restart ssh $ n4 I, B+ ]% {- y2 }; \
******************************************************************************************* 9 D. X5 |9 m9 w: C
' n5 o( _6 [$ b0 I# A
修改固定IP ( s/ r' `6 K" k# }: q" y
/ @9 ?! G" K$ B& a; ]" i5 W% ^1 \cd /etc/netplan/ sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.bak
; D! ~* q- |, [7 U3 Csudo apt update -y sudo apt install net-tools -y
# R$ L' h( B/ y# u( ?5 Bnano 01-network-manager-all.yaml
2 a. i) a% D) {* q; e4 n4 O5 y( Onetwork: 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
( {9 J9 X7 X+ k" `sudo netplan apply
+ A* f0 T* h8 K" p) K************************************************** |