N1刷armbian安装SMB做文件共享

一、刷armbian

N1已降级,“N1-ADBU盘启动(傻瓜包)”开启U盘启动。

  1. 文章推荐armbian 5.77比较稳定。
    https://www.right.com.cn/forum/thread-498873-1-1.html

  2. U盘刷入armbian,下载dtb文件放到U盘dtb文件夹。
    meson-gxl-s905d-phicomm-n1-xiangsm.dtb

  3. 打开uEnv.ini,修改配置
    在这里插入图片描述

  4. U盘插入靠近HDMI接口的USB,N1插电启动,找到N1的IP地址,putty连接
    初始用户名,密码为root,1234

  5. 写入EMMC,完成后关机,拔U盘重启
    /root/install.sh

二、更改软件源

  1. 源文件 /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
  2. 更新
    sudo apt update
    sudo apt upgrade

三、安装SMB

进入armbian-config,到安装软件页面,Samba空格选中,再回车安装。

四、配置SMB

  1. 修改配置文件/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
  1. 修改目录权限
    chmod -R 777 /home/public
  2. 开机启动SMB
    systemctl enable samba
  3. 重启SMB
    systemctl restart samba
  4. 参考
    https://www.cnblogs.com/-xuan/p/10293859.html

五、挂载U盘

  1. 插上U盘,lsblk查看U盘盘符,这里是/dev/sda1
    在这里插入图片描述

  2. 挂载U盘到刚才的共享目录/home/public
    mount /dev/sda1 /home/public

  3. 用命令blkid /dev/sda1查看UUID并记下

  4. 设置开机挂载,nano /etc/fstab,加上以下内容,ntfs为当前U盘类型
    UUID=722059EC2059B835 /home/public ntfs defaults 0 0

  5. 启动挂载(好像不用这步也可以)
    mount -a

  6. 参考
    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,更新时间

  1. ifconfig记录当前MAC地址
  2. 修改配置文件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
  1. 改为上海时区
    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  2. ntp设置
apt -y install ntp
apt -y install ntpdate
ntpdate -u ntp.aliyun.com #阿里云 ntp 服务器
  1. 参考
    https://cyhour.com/1333/
  • 7
    点赞
  • 33
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
n1armbian是指将N1盒子(一种基于Amlogic S905D2芯片的嵌入式盒子)armbian操作系统。Armbian是一个开源的轻量级Linux发行版,专门设计用于ARM架构的嵌入式系统。 首先,armbian操作系统可以带来以下几个优势: 1. 更强大的功能:armbian操作系统提供了许多功能强大的工具和软件包,可以满足用户的多种需求。它支持一键安装服务器应用、多种语言编程支持以及各种硬件的驱动等。 2. 更稳定的性能:相比其他原厂固件,armbian操作系统在稳定性方面更加可靠。其社区积极维护和更新系统,修复可能存在的漏洞和性能问题,确保系统的平稳运行。 3. 更好的定制性:armbian操作系统具有较高的可定制性。用户可以根据自己的需求进行个性化设置,例如更换桌面环境、调整性能参数等。这能让用户更好地适应自己的工作环境。 armbian操作系统的步骤如下: 1. 下载armbian操作系统的镜像文件:可以从官方网站(https://www.armbian.com/)或镜像站点下载对应的N1版本的armbian操作系统镜像文件。 2. 制作启动盘:将下载的镜像文件刻录到一个可启动的USB闪存盘或SD卡中。可以使用诸如Balena Etcher等工具来完成该操作。 3. 进入N1机模式:首先,确保N1盒子断电,并连接USB闪存盘或SD卡。然后按住N1盒子背面Reset孔旁边的Reset按钮,并将电源插入盒子,然后松开Reset按钮。N1将进入机模式。 4. 安装armbian操作系统:将制作好的启动盘插入N1盒子,并启动盒子。按照提示进行操作系统的安装过程。注意选择正确的启动盘和安装选项。 5. 等待安装完成:安装过程可能需要一段时间,请耐心等待。完成后,N1将自动重启,并进入刚安装armbian操作系统。 总之,armbian操作系统可以让N1盒子获得更强大的功能和稳定性,并提供更好的个性化定制选项。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值