#!/bin/bash
8 C7 `5 c/ H8 P' J #set root password sudo passwd root * t7 I: R( h5 l" w/ n8 z% E G
#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 2 ~* X$ Y# H* X, a7 A L
#modify profile sudo sed -i 's/^mesg.*/tty -s \&\& mesg n \|\| true/' /root/.profile 8 }/ K, C, b* L* U! n; ]
#install openssh sudo apt install openssh-server
$ W3 I& a G& a#delay sleep 1 5 [8 @4 B2 b4 I1 d0 X
#modify conf sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config 7 @6 g. K1 V' W, R* k# t
#restart server sudo systemctl restart ssh 3 c$ _) Q3 ~0 X7 _) C; j& _
*******************************************************************************************
( M' `6 X6 E/ k7 y
N; V; x: ?: e3 G修改固定IP * Q/ w/ j/ y, X
" T- ]1 M' [* s {# \) G) J- @! tcd /etc/netplan/ sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.bak
! d6 z5 {/ K; V! y- b. Asudo apt update -y sudo apt install net-tools -y 5 F5 {+ H3 w. T5 ]+ s. k
nano 01-network-manager-all.yaml
. L6 n1 S1 X4 H2 C3 L& ?2 Q4 }& onetwork: 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 0 F Q( P: _8 o: X0 t
sudo netplan apply 8 Z! _' w2 |# \* _- ~7 ]
************************************************** |