Fox-Edge需要依赖一些Linux的基础服务,逐个手动安装是比较费时的事, 下面提供了一键安装命令,简化安装过程
timedatectl set-timezone Asia/Shanghai && \
apt-get update -y && \
apt install net-tools -y && \
apt install netcat -y && \
apt install iputils-ping -y && \
apt install vim -y && \
apt remove --purge redis-server -y && \
apt autoremove -y && \
apt install redis-server -y && \
sed -i 's/bind 127.0.0.1 ::1/# bind 127.0.0.1 ::1/g' /etc/redis/redis.conf && \
sed -i 's/protected-mode yes/protected-mode no/g' /etc/redis/redis.conf && \
sed -i 's/# requirepass foobared/requirepass 12345678/g' /etc/redis/redis.conf && \
systemctl restart redis-server && \
apt-get install samba -y && \
echo -e "\n#------------------#\n[share]\n# 设置共享目录\npath = /\n# 设置访问用户\nvalid users = root\n# 设置读写权限\nwritable = yes\n#------------------#\n" >> /etc/samba/smb.conf && \
echo -e "root\nroot" | smbpasswd -a -s root && \
service smbd restart && \
apt install nginx -y && \
nginx -s reload && \
apt remove -y mosquitto mosquitto-clients && \
apt autoremove -y && \
apt purge -y mosquitto mosquitto-clients && \
apt install -y mosquitto mosquitto-clients && \
systemctl enable mosquitto && \
echo -e "\n# 绑定到所有网络接口\nlistener 1883 0.0.0.0\n" >> /etc/mosquitto/mosquitto.conf && \
echo -e "\n# 使用账号连接\nallow_anonymous false\npassword_file /etc/mosquitto/passwd\n" >> /etc/mosquitto/mosquitto.conf
apt install -y ufw && \
ufw default deny incoming && \
ufw default allow outgoing && \
ufw allow 22/tcp comment 'SSH' && \
ufw allow 80/tcp comment 'HTTP Web' && \
ufw allow 1883/tcp comment 'MQTT Broker'
然后添加密码
mosquitto_passwd -c /etc/mosquitto/passwd admin && \
systemctl restart mosquitto
验证完成之后,再用下面命令开启防火墙
ufw enable