如何啟動(dòng)和停止OpenSSH服務(wù)?

2021-03-11    分類: 網(wǎng)站建設(shè)

OpenSSH服務(wù)的啟動(dòng)和停止
啟動(dòng)和停止OpenSSH服務(wù),可以通過OpenSSH服務(wù)器的啟動(dòng)腳本文件“/etc/rc.d/init.d/sshd”來實(shí)現(xiàn)。另外,也可以使用service命令來啟動(dòng)、停止SSH服務(wù)。具體步驟往下看:
OpenSSH
1.啟動(dòng)OpenSSH服務(wù)
啟動(dòng)OpenSSH服務(wù),可以有兩種不同的方式:通過OpenSSH服務(wù)器的啟動(dòng)腳本文件“/etc/rc.d/init.d/sshd”來啟動(dòng)和使用service命令來啟動(dòng)。
(1)通過OpenSSH服務(wù)器的啟動(dòng)腳本文件啟動(dòng)OpenSSH服務(wù)
通過OpenSSH服務(wù)器的腳本文件“/etc/rc.d/init.d/sshd”啟動(dòng)OpenSSH服務(wù),命令執(zhí)行如下。
[root@localhost ~]# /etc/rc.d/init.d/sshd start
啟動(dòng)sshd:                        [確定]
[root@localhost ~]#
命令執(zhí)行后,OpenSSH服務(wù)開始運(yùn)行。
(2)使用Linux下的service命令啟動(dòng)OpenSSH服務(wù)
使用service命令啟動(dòng)OpenSSH服務(wù),命令執(zhí)行如下。
[root@localhost ~]#service sshd start
啟動(dòng) sshd:                   [確定]
[root@localhost ~]#
命令執(zhí)行后,OpenSSH服務(wù)停止運(yùn)行。
2.重啟OpenSSH服務(wù)
重啟OpenSSH服務(wù),可以有兩種不同的方式:通過OpenSSH服務(wù)器的啟動(dòng)腳本文件“/etc/rc.d/init.d/sshd”來重啟和使用service命令來重啟。
(1)通過OpenSSH服務(wù)器的啟動(dòng)腳本文件重啟OpenSSH服務(wù)
通過OpenSSH服務(wù)器的腳本文件“/etc/rc.d/init.d/sshd”重啟OpenSSH服務(wù),命令執(zhí)行如下。
[root@localhost ~]# /etc/rc.d/init.d/sshd restart
停止sshd:                        [確定]
啟動(dòng)sshd:                        [確定]
[root@localhost ~]#
命令執(zhí)行后,OpenSSH服務(wù)自動(dòng)停止并再次啟動(dòng)。
(2)使用Linux下的service命令重啟OpenSSH服務(wù)
使用service命令重啟OpenSSH服務(wù),命令執(zhí)行如下。
[root@localhost ~]#service sshd restart
停止 sshd:                   [確定]
啟動(dòng) sshd:                   [確定]
[root@localhost ~]#
命令執(zhí)行后,OpenSSH服務(wù)自動(dòng)停止并再次啟動(dòng)。
3.停止OpenSSH服務(wù)
停止OpenSSH服務(wù),可以有兩種不同的方式:通過OpenSSH服務(wù)器的啟動(dòng)腳本文件“/etc/rc.d/init.d/sshd”來停止和使用service命令來停止。
(1)通過OpenSSH服務(wù)器的啟動(dòng)腳本文件停止OpenSSH服務(wù)
通過OpenSSH服務(wù)器的腳本文件“/etc/rc.d/init.d/sshd”停止OpenSSH服務(wù),命令執(zhí)行如下。
[root@localhost ~]# /etc/rc.d/init.d/sshd stop
停止sshd:                        [確定]
[root@localhost ~]#
命令執(zhí)行后,OpenSSH服務(wù)停止運(yùn)行。
(2)使用Linux下的service命令停止OpenSSH服務(wù)
使用service命令停止OpenSSH服務(wù),命令執(zhí)行如下。
[root@localhost ~]#service sshd stop
停止 sshd:                   [確定]
[root@localhost ~]#
命令執(zhí)行后,OpenSSH服務(wù)停止運(yùn)行。
提示:OpenSSH服務(wù)的啟動(dòng)和停止方法、格式都是一樣的,只不過使用的命令不同,比如:停止用stop,啟動(dòng)用start。

本文題目:如何啟動(dòng)和停止OpenSSH服務(wù)?
URL地址:http://www.muchs.cn/news29/104979.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、云服務(wù)器、關(guān)鍵詞優(yōu)化、網(wǎng)站維護(hù)、域名注冊(cè)、App開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)

綿陽服務(wù)器托管