#!/bin/bash
& ?8 \8 b% V( ]1 @6 u5 W #set root password sudo passwd root 5 }6 q: \! a, t% D
#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 ( d; }- I* p4 b9 J
#modify profile sudo sed -i 's/^mesg.*/tty -s \&\& mesg n \|\| true/' /root/.profile ; s: o' D2 X2 q$ s+ @' V
#install openssh sudo apt install openssh-server
" Q8 F! `+ B; J6 V7 G6 Q2 W#delay sleep 1 : _* u; F3 q7 T
#modify conf sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
9 V3 p* f( K/ W8 w _/ N6 i) ~: v3 S#restart server sudo systemctl restart ssh 8 u7 }9 z4 v6 V |8 H0 S# j
*******************************************************************************************
& \; N9 e L% x
4 Y ^7 G9 A% N修改固定IP
0 d" X4 \) N! e1 m- k) Z, t' [: ^
* t) q8 s8 h2 d" l) j; rcd /etc/netplan/ sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.bak 2 M+ T2 V+ L7 f' E0 G& t
sudo apt update -y sudo apt install net-tools -y
& Y5 `2 G/ I- L" L& Y0 b8 |nano 01-network-manager-all.yaml 3 P8 d# }8 B- |0 i; V
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
( H7 l9 k- Q9 z! a1 |% o' jsudo netplan apply ) v0 n6 r. Q$ W
************************************************** |