#!/bin/bash
7 _* F7 m+ n {9 a #set root password sudo passwd root
7 A0 _( z. q2 f! h, r#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
" `+ x: r0 s9 {4 J) P#modify profile sudo sed -i 's/^mesg.*/tty -s \&\& mesg n \|\| true/' /root/.profile & Y' z$ Z+ Q- ~% m" b b4 ^
#install openssh sudo apt install openssh-server , W* q" y. ]5 u. M, z
#delay sleep 1 9 [( F7 L$ ]# e9 X. a
#modify conf sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
$ s; ~- z1 P# E6 ]#restart server sudo systemctl restart ssh
( ]9 P; k' e. M) |*******************************************************************************************
1 e) O' f1 @: u) a$ y# H1 v2 h% N# f/ k% y( ^( c+ @& I$ A$ O( E6 c, s
修改固定IP
- @5 \: k" E$ G* \
# `, _+ y* v$ f2 k( H4 icd /etc/netplan/ sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.bak
' Z. f& e5 C0 Csudo apt update -y sudo apt install net-tools -y
2 B+ Q% ~; w+ }0 unano 01-network-manager-all.yaml # J3 X& v" t( X" x: M$ {, z' _5 X7 O
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
; e0 Y9 F) ?: J! P: w9 }sudo netplan apply
" t) ]3 D7 D+ j4 P/ e* i/ g************************************************** |