#!/bin/bash + V5 T& ^ W8 Z0 m
#set root password sudo passwd root
1 S' i4 t- i9 d; R. X: }#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 & g( m* e* F6 E) I, ^# g4 x& \
#modify profile sudo sed -i 's/^mesg.*/tty -s \&\& mesg n \|\| true/' /root/.profile , G2 y0 a% N" k8 z
#install openssh sudo apt install openssh-server 6 o0 ?" H, E+ g
#delay sleep 1
+ E8 R2 P$ S! Q" R2 |+ b' ]6 i#modify conf sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config 9 T, c. a/ f: ^+ B. u+ G
#restart server sudo systemctl restart ssh $ Z, @7 j0 D/ B2 y! b! ?! a
******************************************************************************************* 0 {; j; m. O) `* G9 E$ N% x
; d5 c" B6 X* h1 S# N, n' W修改固定IP i/ d! s4 J% a, B* L5 F& }& L
0 A4 p" W5 }: d n6 m; |cd /etc/netplan/ sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.bak
4 V& r! w y) y+ r+ I6 ^sudo apt update -y sudo apt install net-tools -y
, I- k$ ?& n0 Nnano 01-network-manager-all.yaml / ~% `* ]8 O: m! y
network: 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
+ }, h$ ^* Z$ K9 x& ~sudo netplan apply
$ R7 R6 D$ p5 E% }************************************************** |