N1刷armbian安装SMB做文件共享
一、刷armbianN1已降级,“N1-ADBU盘启动(傻瓜包)”开启U盘启动。文章推荐armbian 5.77比较稳定。https://www.right.com.cn/forum/thread-498873-1-1.htmlU盘刷入armbian,下载dtb文件放到U盘dtb文件夹。meson-gxl-s905d-phicomm-n1-xiangsm.dtb打开uEnv.ini,修改配置U盘插
一、刷armbian
N1已降级,“N1-ADBU盘启动(傻瓜包)”开启U盘启动。
-
文章推荐armbian 5.77比较稳定。
https://www.right.com.cn/forum/thread-498873-1-1.html
-
U盘刷入armbian,下载dtb文件放到U盘dtb文件夹。
meson-gxl-s905d-phicomm-n1-xiangsm.dtb
-
打开uEnv.ini,修改配置
-
U盘插入靠近HDMI接口的USB,N1插电启动,找到N1的IP地址,putty连接
初始用户名,密码为root,1234
-
写入EMMC,完成后关机,拔U盘重启
/root/install.sh
二、更改软件源
- 源文件 /etc/apt/sources.list
中科大源
deb http://mirrors.ustc.edu.cn/debian stretch main contrib non-free
deb http://mirrors.ustc.edu.cn/debian stretch-updates main contrib non-free
deb http://mirrors.ustc.edu.cn/debian stretch-backports main contrib non-free
deb http://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free
清华源
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ stretch-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security/ stretch/updates main contrib non-free
阿里源
deb http://mirrors.aliyun.com/debian stretch main contrib non-free
deb http://mirrors.aliyun.com/debian stretch-proposed-updates main contrib non-free
deb http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch-proposed-updates main contrib non-free
deb-src http://mirrors.aliyun.com/debian stretch-updates main contrib non-free
deb http://mirrors.aliyun.com/debian-security/ stretch/updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian-security/ stretch/updates main non-free contrib
deb http://mirrors.aliyuncs.com/debian stretch main contrib non-free
deb http://mirrors.aliyuncs.com/debian stretch-proposed-updates main contrib non-free
deb http://mirrors.aliyuncs.com/debian stretch-updates main contrib non-free
deb-src http://mirrors.aliyuncs.com/debian stretch main contrib non-free
deb-src http://mirrors.aliyuncs.com/debian stretch-proposed-updates main contrib non-free
deb-src http://mirrors.aliyuncs.com/debian stretch-updates main contrib non-free
deb http://mirrors.aliyuncs.com/debian-security/ stretch/updates main non-free contrib
deb-src http://mirrors.aliyuncs.com/debian-security/ stretch/updates main non-free contrib
- 更新
sudo apt update
sudo apt upgrade
三、安装SMB
进入armbian-config,到安装软件页面,Samba空格选中,再回车安装。
四、配置SMB
- 修改配置文件
/etc/samba/smb.conf
,直接覆盖原内容,实现匿名直接连接。
[global]
workgroup = WORKGROUP
server string = Samba Server Version %v
passdb backend = tdbsam
cups options = raw
security = user #认证模式为User
map to guest = bad user #这个很关键,实现匿名无须交互输入用户名和密码就靠它了
guest account = guest #匿名用户映射为guest用户
[myshare] #共享后看到的文件夹名
comment = My share
path = /home/public #共享路径
browseable = Yes #可以被浏览,就是在网络邻居中能看到共享名
read only = No #可读写
guest ok = Yes #允许匿名访问,这个也需要设置,否则匿名无法访问
valid users = samba liuag guest #有效的用户和组
invalid users = liuben #无效用户和组
read list = samba #只读用户和组(如果read only = No,只读用户需要在此设置)
write list = liuag #可读写用户和组(如果read only = Yes,可读写用户需要在此设置)
allow hosts = 192.168.100.236 #允许访问主机列表,支持通配符
deny hosts = 192.168.100.0/24 #禁止访问主机列表,支持通配符
简洁版
[global]
workgroup = WORKGROUP
security = user
map to guest = Bad User
[media]
comment = resources
path = /home/public
public = yes
writable = yes
guest ok = yes
browseable = yes
- 修改目录权限
chmod -R 777 /home/public
- 开机启动SMB
systemctl enable samba
- 重启SMB
systemctl restart samba
- 参考
https://www.cnblogs.com/-xuan/p/10293859.html
五、挂载U盘
-
插上U盘,
lsblk
查看U盘盘符,这里是/dev/sda1
-
挂载U盘到刚才的共享目录
/home/public
mount /dev/sda1 /home/public
-
用命令
blkid /dev/sda1
查看UUID并记下 -
设置开机挂载,
nano /etc/fstab
,加上以下内容,ntfs为当前U盘类型
UUID=722059EC2059B835 /home/public ntfs defaults 0 0
-
启动挂载(好像不用这步也可以)
mount -a
-
参考
https://blog.csdn.net/qq_38265101/article/details/105470939
https://www.right.com.cn/forum/thread-1285840-1-1.html
https://zorz.cc/post/flash-phicomm-n1-and-smb.html
六、固定MAC,更新时间
ifconfig
记录当前MAC地址- 修改配置文件
nano /etc/network/interfaces
source /etc/network/interfaces.d/*
# Wired adapter #1
#allow-hotplug eth0
auto eth0
no-auto-down eth0
iface eth0 inet dhcp
hwaddress fc:7b:07:87:44:33 #新增此条
#address 192.168.0.100
#netmask 255.255.255.0
- 改为上海时区
cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
- ntp设置
apt -y install ntp
apt -y install ntpdate
ntpdate -u ntp.aliyun.com #阿里云 ntp 服务器
- 参考
https://cyhour.com/1333/
更多推荐
所有评论(0)