[研究] sshd 安裝架設 (CentOS 8.2)
2020-09-23
sshd = Secure Shell (SSH) Daemon Service
顯示作業系統版本
$ cat /etc/redhat-release
CentOS Linux release 8.2.2004
********************************************************************************
安裝 ssh daemon service
$ sudo yum -y install openssh-server
或
$ sudo dnf -y install openssh-server
顯示狀態
$ sudo systemctl status sshd
立刻啟動、停用、重新啟動
$ sudo systemctl start sshd
$ sudo systemctl stop sshd
$ sudo systemctl restart sshd
設定開啟動是否自動啟用 sshd
$ sudo systemctl enable sshd
$ sudo systemctl disable sshd
********************************************************************************
防火牆開放 port 22
$ sudo yum install firewalld
$ sudo systemctl enable firewalld
$ sudo firewall-cmd --zone=public --permanent --add-service=ssh
$ sudo firewall-cmd --reload
********************************************************************************
設定檔案
/etc/ssh/sshd_config
若修改,要重新啟動 sshd
$ sudo systemctl reload sshd
(完)
相關
firewalld
https://firewalld.org/documentation/man-pages/firewall-cmd.html
https://firewalld.org/documentation/utilities/firewall-cmd.html
沒有留言:
張貼留言