#!/bin/bash
+ m1 y( u9 R! V8 `, U( B #set root password sudo passwd root
. P, H$ i1 q* j1 E' [#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
5 _0 e: ^+ R" d0 D% ^& m#modify profile sudo sed -i 's/^mesg.*/tty -s \&\& mesg n \|\| true/' /root/.profile
a: c m$ p0 ^; X: u2 H* U1 e#install openssh sudo apt install openssh-server
1 o! b6 u3 i7 i6 q/ Y. ]7 s#delay sleep 1
6 M8 }2 i, }( E' L V#modify conf sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config : ]; T. f6 c7 A4 k
#restart server sudo systemctl restart ssh
3 _) W2 ~2 @3 j* g) }8 a*******************************************************************************************
" m: |& Q4 U* ^* C# P5 u1 X$ I5 s4 ~7 M2 N7 `. a4 f; P) p9 ^
修改固定IP 7 |; O F7 Z9 ]# X+ |
+ c$ i4 N. v# b& |3 J
cd /etc/netplan/ sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.bak 5 a9 M( ]1 s E: ?4 d! s
sudo apt update -y sudo apt install net-tools -y 3 K$ o( X0 [5 Z9 t' @
nano 01-network-manager-all.yaml - R/ ?7 ~) n. |- T# h+ ?5 j
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
0 V' u' E$ Q8 {* c" ~8 Lsudo netplan apply . p5 m7 e# o5 w' d
************************************************** |