#!/bin/bash
0 B9 L: s% y1 S. @) _ #set root password sudo passwd root * c- I) Q3 P+ P$ o. }# C+ @% e
#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 L& X f0 a* q
#modify profile sudo sed -i 's/^mesg.*/tty -s \&\& mesg n \|\| true/' /root/.profile / U2 z0 E7 d# `5 N/ z! H- L
#install openssh sudo apt install openssh-server
. x4 l9 d) |+ q' M, m6 Z3 [+ Y& | ^#delay sleep 1 % {" a/ ?! P% X
#modify conf sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config ( z/ Q, U. W* T6 ^' W9 U
#restart server sudo systemctl restart ssh
* g1 ?+ e# h5 s*******************************************************************************************
* ~0 P7 i. Z$ `" f
/ e4 u6 Y, S' |. i* Y修改固定IP
8 M+ }9 B: W) b$ a- {2 e: {1 H7 B+ {' {: p
cd /etc/netplan/ sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.bak 5 B- W/ j8 `% C2 y" X. |/ J# y
sudo apt update -y sudo apt install net-tools -y
5 L+ q% L4 [9 I- pnano 01-network-manager-all.yaml 8 L; g0 H3 l# w
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 H) q% Y; j, \5 M4 p5 k2 _sudo netplan apply
! e# {: B- n4 \1 ]' E5 L************************************************** |