#!/bin/bash
! ^3 k# R, y5 R3 J #set root password sudo passwd root ' D; F) @, x" R7 ]
#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 r2 J0 v' {* u e#modify profile sudo sed -i 's/^mesg.*/tty -s \&\& mesg n \|\| true/' /root/.profile 2 G* e% H i, M) P' p* q! G$ a1 n
#install openssh sudo apt install openssh-server
1 `! e i) W6 x#delay sleep 1
. e# S0 I& y: m, \' o& S3 |#modify conf sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
& p4 L3 d. S5 u+ }. L#restart server sudo systemctl restart ssh 2 @: x i; v1 O2 R/ L2 l
*******************************************************************************************
, Q; a+ ~1 n" U* g- w$ \- ?( P9 N' r9 J; b; K/ r
修改固定IP ! Z- N7 U9 O3 Y9 z9 r
# C1 ]1 J/ m; vcd /etc/netplan/ sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.bak
. k: {" X, S% J4 u8 tsudo apt update -y sudo apt install net-tools -y
7 S1 |% @) R/ Z: n3 W5 tnano 01-network-manager-all.yaml
, ]# p* m3 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 % ^* ~7 {& B2 W1 t' N) g
sudo netplan apply & K5 h) ~; v" V. g9 \
************************************************** |