Centos安裝後啓動ssh服務

安裝好Centos後發現沒有ip

Centos顯示ip

  1. 編輯/etc/sysconfig/network-scripts/ifcfg-ens33文件
  2. 修改ONBOOT屬性爲yes
  3. 保存退出
  4. 重啓網卡:systemctl restart network
  5. 使用ifconfig命令查看ip信息

啓動ssh服務

  1. 輸入以下命令查看是否安裝了openssh-server

    yum list installed | grep openssh-server

  2. 如果沒有安裝,則輸入以下命令安裝openssh-server

    yum install openssh-server

  3. 編輯/etc/ssh/sshd_config文件(注意不是ssh_config),查找並修改以下屬性(去除’#’,即去除註釋)

    Port 22
    ListenAddress 0.0.0.0
    ListenAddress ::
    PermitRootLogin yes
    PasswordAuthentication yes

  4. 開啓sshd服務

    sudo service sshd start

  5. 查看sshd服務是否啓動

    ps -e | grep sshd

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章