第33行: | 第33行: | ||
service ssh restart | service ssh restart | ||
ssh -p 50000 ubuntu@12.98.23.12 | 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> | </syntaxhighlight> | ||
[[Category:Linux/Unix]] | [[Category:Linux/Unix]] |
2025年10月5日 (日) 05:37的版本
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