Debian10開啓root遠程登錄

最小化安裝Debian10系統,ssh服務未安裝且root不允許登錄。
安裝開啓ssh 服務並允許root登錄
 
具體操作
1、添加國內源,安裝ssh服務並啓動
su - root
#添加
deb http://ftp.cn.debian.org/debian/ buster main
deb  http://ftp2 .cn. debian.org /debian/  buster   main
#安裝
apt-get install openssh openssh-server openssh-client
systemctl enable sshd.service
systemctl start sshd.service
 
2、修改/etc/ssh/sshd_config文件,將 #PermitRootLogin   prohibit-password 的註釋去掉,將   prohibit-password 改爲yes
sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/g' /etc/ssh/sshd_config
 
3、重啓ssh服務:systemdctl restart sshd.service

 

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