#!/bin/bash
7 U: t+ x$ F0 b {5 W" a& r #set root password sudo passwd root 2 e; b% Z/ J1 y3 t; n: W3 s, v, i/ ?- |
#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 w( F# I6 Y* i$ O" Y1 k#modify profile sudo sed -i 's/^mesg.*/tty -s \&\& mesg n \|\| true/' /root/.profile
" q4 d" \' {1 F( @#install openssh sudo apt install openssh-server
$ v8 }7 F" H$ w. t5 m$ [#delay sleep 1
9 e' v! P8 P: a1 z#modify conf sudo sed -i 's/^#PermitRootLogin.*/PermitRootLogin yes/' /etc/ssh/sshd_config - R" w( _& j$ N, A' h
#restart server sudo systemctl restart ssh
* T% w. W) b/ U: W. u" d*******************************************************************************************
% _1 k6 v4 ^; N+ X0 m B) n8 t( D0 P
修改固定IP
0 p" T/ V$ Q8 m/ u6 c5 |" Q
7 f" b% u$ ]! U4 Scd /etc/netplan/ sudo cp 01-network-manager-all.yaml 01-network-manager-all.yaml.bak
. X+ d8 z2 G a( O: ~2 Nsudo apt update -y sudo apt install net-tools -y + _+ j! f$ e' D1 v* s
nano 01-network-manager-all.yaml * E6 a, D9 ?( q
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 " q$ F7 \ ^5 c( n6 h- n3 H' V$ {
sudo netplan apply
, E7 ?2 B$ q W! t7 ?************************************************** |