Riguz留言 | 贡献
创建页面,内容为“ Category:Linux/Unix
 
Riguz留言 | 贡献
 
(未显示同一用户的9个中间版本)
第1行: 第1行:
=System settings =
== Update system ==
<syntaxhighlight lang="bash">
sudo apt update
sudo apt upgrade
do-release-upgrade


reboot
</syntaxhighlight>


== hostname  ==
<syntaxhighlight lang="bash">
vim /etc/hostname
</syntaxhighlight>
== user ==
<syntaxhighlight lang="bash">
adduser ubuntu
usermod -aG sudo ubuntu
</syntaxhighlight>
== ssh config ==
<syntaxhighlight lang="bash">
ssh-copy-id -p 50000 ubuntu@12.98.23.12
# vim /etc/ssh/sshd_config
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
service ssh restart
ssh -p 50000 ubuntu@12.98.23.12
</syntaxhighlight>
== ufw==
<syntaxhighlight lang="bash">
sudo ufw enable
sudo ufw allow 80
sudo ufw allow 443
sudo ufw allow 50000
sudo ufw status numbered
</syntaxhighlight>
== V2ray ==
[[V2Ray global proxy]]
= Web server =
== Ngnix ==
<syntaxhighlight lang="bash">
$ sudo apt install nginx
$ sudo systemctl status nginx
</syntaxhighlight>
== Certbot ==
Install via pip<ref>https://certbot.eff.org/instructions?ws=nginx&os=pip&commit=%3E</ref>
<syntaxhighlight lang="bash">
sudo apt install certbot
sudo apt install python3 python3-dev python3-venv libaugeas-dev gcc
sudo python3 -m venv /opt/certbot/
sudo /opt/certbot/bin/pip install --upgrade pip
sudo /opt/certbot/bin/pip install certbot certbot-nginx
sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot
sudo certbot --nginx
sudo nginx -s reload
</syntaxhighlight>


[[Category:Linux/Unix]]
[[Category:Linux/Unix]]

2025年10月5日 (日) 14:44的最新版本

System settings

Update system

sudo apt update
sudo apt upgrade
do-release-upgrade

reboot

hostname

vim /etc/hostname

user

adduser ubuntu
usermod -aG sudo ubuntu

ssh config

ssh-copy-id -p 50000 ubuntu@12.98.23.12

# vim /etc/ssh/sshd_config
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes

service ssh restart
ssh -p 50000 ubuntu@12.98.23.12

ufw

sudo ufw enable
sudo ufw allow 80
sudo ufw allow 443
sudo ufw allow 50000
sudo ufw status numbered

V2ray

V2Ray global proxy

Web server

Ngnix

$ sudo apt install nginx
$ sudo systemctl status nginx

Certbot

Install via pip[1]

sudo apt install certbot
sudo apt install python3 python3-dev python3-venv libaugeas-dev gcc
sudo python3 -m venv /opt/certbot/
sudo /opt/certbot/bin/pip install --upgrade pip
sudo /opt/certbot/bin/pip install certbot certbot-nginx
sudo ln -s /opt/certbot/bin/certbot /usr/bin/certbot
sudo certbot --nginx
sudo nginx -s reload