#!/bin/bash
6 u' u' }/ ?( r% U: @% T #set root password sudo passwd root - S' n2 N& I9 e+ q1 J
#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
9 n; S8 q9 K7 L' b9 D! k) z#modify profile sudo sed -i 's/^mesg.*/tty -s \&\& mesg n \|\| true/' /root/.profile
) B j( I- U( \9 s# m3 h+ F#install openssh sudo apt install openssh-server
% ?7 c3 T ^+ M7 m/ L! S9 a, {( Y2 I# ]#delay sleep 1
0 n$ W" d! n+ }& _/ Z#modify conf sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config
; l" U+ i# m: @0 c( n. z+ e4 S#restart server sudo systemctl restart ssh
% u# w0 i" i8 x*******************************************************************************************
! ^* L/ y3 K; W4 t0 t, g, b: V2 h
修改固定IP
1 J& c5 f" j. b
8 u6 W9 V$ F4 Z) g" }cd /etc/netplan/ sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.bak
; M4 `" B& D3 s: p; n: ?sudo apt update -y sudo apt install net-tools -y
9 s+ u( b( _( r; `nano 01-network-manager-all.yaml
5 S; F( @1 z8 Znetwork: 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 & x. b; I. o8 L4 ?" l$ B" E
sudo netplan apply
/ V; d2 Z# A$ E& Y, x# P# e************************************************** |