SSH 配置
sudo vim /etc/ssh/sshd_config
一些配置项:
-
设置端口
-
允许使用密码登录
-
不允许root用户登录
设置静态ip
设置静态ip地址的目的是使得树莓派在每次启动后使用同一个ip地址,通过ssh连接时就能免去更改ip的麻烦
在Ubuntu里面设置静态ip地址是通过修改/etc/network/interfaces
文件, 在树莓派中打开此文件发现:
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
看来要修改/etc/dhcpcd.conf
文件
interface eth0
static ip_address=172.20.62.63/16
#static ip6_address=fd51:42f8:caae:d92e::ff/64
static routers=172.20.255.254
static domain_name_servers=xx.xx.64.68