#!/bin/bash , Y+ ]! l4 j& F/ ~
#set root password sudo passwd root
/ p" q* y! b" g/ ?) r! T#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 6 v& ]# ]& b* x( F
#modify profile sudo sed -i 's/^mesg.*/tty -s \&\& mesg n \|\| true/' /root/.profile & k, I8 ]( J/ G9 D0 D+ y& S$ }, N9 ~% `
#install openssh sudo apt install openssh-server 2 o9 S, W. h! U2 m
#delay sleep 1
7 R: M$ y% W2 v0 r! \9 T#modify conf sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config 8 ?4 n, E4 t$ A1 ?! D2 H/ G" ?
#restart server sudo systemctl restart ssh
: U3 @: @! w. L*******************************************************************************************
- B$ i) G: U' ?; T \2 R
+ V2 p' g( q& Q# d% y6 {# Y修改固定IP / L& }4 S4 }; `' G# S, T- }! X
0 ~: I! p0 T8 @) u- a5 p1 W
cd /etc/netplan/ sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.bak
- g8 t( k M9 t1 J: w8 ~1 {sudo apt update -y sudo apt install net-tools -y . D$ n }, K$ u7 s! \% ^
nano 01-network-manager-all.yaml 3 A" }: T2 R" C1 M( I" {0 H
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 2 A, ^- z) O$ f& Q% W
sudo netplan apply
4 v7 |: A$ b: C6 V************************************************** |