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

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

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

分享名稱:如何啟動和停止OpenSSH服務(wù)?
當(dāng)前地址:http://www.bm7419.com/news/104979.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供移動網(wǎng)站建設(shè)、網(wǎng)站收錄、建站公司、微信小程序、搜索引擎優(yōu)化服務(wù)器托管

廣告

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

網(wǎng)站優(yōu)化排名