SA程序安装 Doc Ver: 1.1 系统:Debian i386 1. 安装系统 以最小Debian系统安装,添加debian为用户,选择安装SSH服务。 2. 更新系统 完成安装后,以root登录系统; apt-get update -y apt-get upgrade -y 3. 安装必须的系统程序包 apt-get install lighttpd vim nmap curl wget php-cli php-curl php-json php-cgi php-json php-mysql php-sqlite3 libfcgi php-fpm net-tools libglib2.0-bin sqlite3 sudo -y reboot 重启后以root再次登录 4. 用户权限设置 chmod +w /etc/sudoers vim /etc/sudoers 更改文件内容如下: # User privilege specification root ALL=(ALL:ALL) ALL debian ALL=(ALL:ALL) ALL #debian ALL=NOPASSWD:ALL # Allow members of group sudo to execute any command %sudo ALL=NOPASSWD:ALL #%sudo ALL=(ALL:ALL) ALL 保存后退出。 chmod -w /etc/sudoers gpasswd -a debian sudo gpasswd -a debian adm 5. 启用ifconfig 以debian登录 sudo ln -s /usr/sbin/ifconfig /usr/bin/ 6. 更改网卡名为标准eth0 sudo vim /etc/default/grub 更改 GRUB_CMDLINE_LINUX="" 为 GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0" 保存退出 查找网卡名,运行ifconfig 例如,查找到如‘enp1s0’的网卡名,则运行以下指令 sudo sed -i 's/enp1s0/eth0/g' /etc/network/interfaces sudo grub-mkconfig -o /boot/grub/grub.cfg 重新启动,系统将启用新网卡名和网络地址。 7. 安装SA主程序 以debian登录 wget http://www.casstk.com/sa/install.sh bash install.sh 结束后重启系统。 8. 增加自启动脚本 以debian登录 新增文件: sudo vim /etc/systemd/system/rc-local.service 编辑内容: [Unit] Description=/etc/rc.local ConditionPathExists=/etc/rc.local [Service] Type=forking ExecStart=/etc/rc.local start TimeoutSec=0 StandardOutput=tty RemainAfterExit=yes SysVStartPriority=99 [Install] WantedBy=multi-user.target 新增文件: sudo vim /etc/rc.local 内容: #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. exit 0 添加权限: sudo chmod +x /etc/rc.local 设置到系统启动: sudo systemctl enable rc-local 启动脚本: sudo systemctl start rc-local.service 检查服务状态: sudo systemctl status rc-local.service 9. 增加SA自启动 以debian登录 sudo vim /etc/rc.local 修改成以下内容: cd /var/sa/bin/ sudo -u debian ./daq.sh & sudo shellinaboxd -t -b 保存,并重启系统。 10. 去除GPIO控制和面板指示灯 网页访问设备地址 菜单->设置->高级->面板指示灯,取消‘启用’勾选,保存 菜单->设置->高级->GPIO,取消‘启用’勾选,保存