天天看點

CentOS7開啟ssh服務并使用xshell連接配接

文章目錄

    • 一、開啟ssh服務
    • 二、使用[Xshell6](https://www.portablesoft.org/xshell-xftp-6-integrated/)連接配接伺服器

一、開啟ssh服務

  1. 先檢查有沒有安裝ssh服務:

    rpm -qa | grep ssh

    CentOS7開啟ssh服務并使用xshell連接配接
  2. 如果沒有就安裝openssh-server:

    yum install openssh-server

  3. 檢視并修改ssh配置:

    vim /etc/ssh/sshd_config

    CentOS7開啟ssh服務并使用xshell連接配接
  4. 啟動ssh服務:

    /bin/systemctl start sshd.service

  5. 檢查ssh服務是否開啟:

    ps -e | grep sshd

    CentOS7開啟ssh服務并使用xshell連接配接
  6. 檢查 22端口 是否開啟:

    ps -e | grep 22

    CentOS7開啟ssh服務并使用xshell連接配接
  7. 将ssh服務添加到自啟動清單中:

    systemctl enable sshd.service

二、使用Xshell6連接配接伺服器

建立新的會話

CentOS7開啟ssh服務并使用xshell連接配接

連接配接即可,自己測試可以使用root使用者登陸

繼續閱讀