ufw下使用ssh與mosh

ufw下使用ssh與mosh

SSH

安裝ssh

sudo apt-get install openssh-server

設定

sudo vim /etc/ssh/sshd_config

禁止root登入

PermitRootLogin prohibit-password

關閉密碼登入

PasswordAuthentication no

重新啟動

sudo systemctl restart sshd.service

 

ufw setting

sudo ufw allow ssh

or

sudo ufw allow 22/tcp

or

sudo ufw allow 2222/tcp

 

MOSH

安裝mosh

sudo apt-get install python-software-properties
sudo add-apt-repository ppa:keithw/mosh
sudo apt-get update
sudo apt-get install mosh

ufw setting

sudo ufw allow 60000:61000/udp

 

關掉可把allow改成deny

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *