新版raspbian系統的固定IP配置和啓用root帳戶的ssh登陸功能的方法

1. 2016新版raspbian系統的固定IP配置:ssh

自2016年2月份新版raspbian系統發佈之後,樹莓派的固定IP配置方法就與以前不同了。ip

以前在raspbian系統中編輯/etc/network/interfaces文件就能夠生效的固定IP配置,在新版raspbian系統中徹底沒法使用。但新方法貌似也比較簡單:it

首先,確認/etc/network/interfaces中,登錄

iface eth0 inet manual配置

這行,末尾是manual,而後,編輯/etc/dpcpcd.conf,在末尾添加:network

interface eth0密碼

static ip_address=xxx.xxx.xxx.xxx/xx方法

重啓後就OK了。static

 

2. 樹莓派的root帳戶ssh登陸設置:文件

首先,用pi用戶登陸(默認密碼是raspberry)後,執行sudo passwd root命令,修改root密碼;

而後,編輯/etc/ssh/sshd_config文件,找到PermitRootLogin一行;

若是以前執行過「sudo passwd --unlock root」的話,這裏可能會顯示「without-passwd」什麼的,把這行修改成「PermitRootLogin yes」,保存退出而後重啓系統,root帳號應該能夠直接登陸了。

相關文章
相關標籤/搜索