#登录 ssh root@ip
#清除记录 ssh-keygen -R ip
#允许root登录
nano /etc/ssh/sshd_config
PermitRootLogin yes (默认为#PermitRootLogin prohibit-password)
#启用root
sudo passwd root
#删除账户
deluser username
deluser --remove-home username
1、系统有相应的python解释器,并在脚本头部声明,例如:#!/usr/bin/python
2、给予该脚本可执行权限,如:chmod +x somescript.py
3、脚本接受第一个命令参数,需要能接受至少包含start的参数,至于stop、restart以及status等并不是必须的,你可以自己来扩展。如: ./somescript.py start 这种命令格式来启动程序
4、将该脚本放到/etc/rc.d/init.d/路径下
5、chkconfig --add somescript.py添加服务
6、chkconfig --level 3 somescript.py on 在init为3或5的级别上开机启动该服务
在运行chkconfig时,程序会报错,需要在文件中加入:
1 #chkconfig:- 85 15 2 #description:xxxx is a service
建议将init级别设置为3,因为设置为5时,会运行两次脚本。
后期发现,级别3也存在同样的问题
Django
django-admin startproject mystie #新建项目
python3 manage.py startapp mysit #新建APP
python3 manage.py collectstatic #项目所有静态文件存放
网站
https://github.com/gijzelaerr/python-snap7 Github Python-Snap7
http://snap7.sourceforge.net/ Snap7官网
https://blog.csdn.net/weixin_29482793 其他参考