Raspberry开启ssh和root账号

Raspberry安装系统是Raspbian Stretch Lite。现在系统默认都是关闭ssh和root账号的。我的pi没有屏幕,没ssh,很不方便。

1. 开启ssh。安装好系统后,在sd卡根目录创建一个ssh文件。文件名就是ssh,没有后缀,不需要内容,放在根目录。然后把sd卡插到板子上,通电开机。再使用默认账号pi,密码raspberry即可ssh链接。

2. 开启root账号。

使用默认账号pi,密码raspberry,ssh到系统

pi@raspberrypi:~$ sudo passwd root
Enter new UNIX password:   #输入第一遍密码
Retype new UNIX password:  #输入第二遍密码

修改一下ssh的配置文件

pi@raspberrypi:~$ sudo nano /etc/ssh/sshd_config

将#PermitRootLogin without-password,修改为PermitRootLogin yes

ctrl x保存退出,执行下面命令重启ssh。

pi@raspberrypi:~$ sudo service ssh restart

 

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注