ubuntu下允許root用戶ssh遠程登錄

SSH服務器,可以通過SSH協議來訪問遠程服務器,代替telnet和ftp。但是ubuntu默認是不啓用root用戶也不允許root遠程登錄的。所以需要先啓用root用戶

啓用root用戶:sudo passwd root //修改密碼後就啓用了。

安裝OpenSSH server:

  1. 使用apt命令安裝openssh server
    $ sudo apt-get install openssh-server

  2. 可以對 openssh server進行配置
    $ sudo vi /etc/ssh/sshd_config
    找到PermitRootLogin no 一行,改爲PermitRootLogin yes

  3. 重啓 openssh server
    $ sudo service ssh restart

  4. 客戶端如果是ubuntu的話,則已經安裝好ssh client,可以用下面的命令連接遠程服務器。
    $ ssh ip
    如果是windows系統的話,可以使用SSH Secure Shell等ssh軟件進行遠程連接。
    [c:\~]$ ssh root@ip
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章