YangYouji's WebSite

树莓派 设置固定IP/添加用户/修改密码

备份

pi@raspberry: sudo cp /etc/network/interfaces /etc/network/interfaces.sav

修改

pi@raspberry: sudo vi /etc/network/interfaces

iface eth0 inet dhcp ->  #iface eth0 inet dhcp

添加

# The loopback interface
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
#your static IP
address 192.168.1.118
#your gateway IP
gateway 192.168.1.1
netmask 255.255.255.0
#your network address “family”
network 192.168.1.0
broadcast 192.168.1.255

重启网络

pi@raspberry:sudo /etc/init.d/networking restart

或者

pi@raspberry:sudo /etc/init.d/networking reload

 

添加用户

useradd –g aft –s /sbin/nologin -d /home/pi/aft ftpuser

修改密码

passwd ftpuser

退出移动版