1. 关闭linux系统中指定的端口
- sudo fuser -k -n tcp 端标语 比方:sudo fuser -k -n tcp 8000
复制代码 2. python模块安装下令
- pip install 模块名 -i https://pypi.tuna.tsinghua.edu.cn/simple(https://pypi.douban.com/simple/)
复制代码 3. 管理django的mysql问题
- import pymysqlpymysql.version_info = (1, 4, 13, "final", 0)pymysql.install_as_MySQLdb() # 使用pymysql取代mysqldb毗连数据库
复制代码 4. python安装yaml(剖析.yml文件
- 安装,输入:pip install pyyaml 大概 pip3 install pyyaml
复制代码 5. -bash: ls: 未找到下令
- 执行:export PATH=/bin:/usr/bin:$PATH
复制代码 6. Linux查询正在运行的python步伐
7.测试linux是否能访问外网
- curl -l http://www.baidu.com
复制代码
- wget http://www.baidu.com
复制代码 8.CentOS 7安装和设置ssh
- yum install -y openssl openssh-server
复制代码
- 修改设置文件(用vim打开设置文件/etc/ssh/sshd_config)
将上图的PermitRootLogin,RSAAuthentication,PubkeyAuthentication的设置打开。
- 启动ssh的服务
- systemctl start sshd.service
复制代码- systemctl enable sshd.service
复制代码
- 设置文件夹~/.ssh的访问权限(authorized_keys文件存储的是客户端的公共密钥)
- cd ~chmod 700 .sshchmod 600 .ssh/*ls -la .ssh
复制代码 9.Ubuntu 18.04安装和毗连ssh
- root@be4defdb43d7:/# apt-get updateroot@be4defdb43d7:/# apt-get upgraderoot@be4defdb43d7:/# apt-get install vimroot@be4defdb43d7:/# apt-get install openssh-server
复制代码 到这里,所有的准备工作就完成了,下面开始实际利用毗连ssh。
- 设置一个root暗码,反面登岸会用到,根据自己的情况设置一个暗码
- root@be4defdb43d7:/# passwd
复制代码- root@be4defdb43d7:/# vim /etc/ssh/sshd_config
复制代码 注释这一行PermitRootLogin prohibit-password,添加一行PermitRootLogin yes,如下所示:
- #PermitRootLogin prohibit-passwordPermitRootLogin yes
复制代码- root@be4defdb43d7:/# /etc/init.d/ssh restart * Restarting OpenBSD Secure Shell server sshd
复制代码 9.Ubuntu系统 Linux root用户不能通过SSH毗连的问题
- 确认ssh服务已安装,通过平常用户毗连乐成
- 确认ssh设置是否对root举行特殊设置,修改/etc/ssh/sshd_config文件中,PermitRootLogin without-password将 without-password改为yes,如下所示:
- #PermitRootLogin without-password#PermitRootLogin prohibit-passwordPermitRootLogin yes
复制代码- root@be4defdb43d7:/# /etc/init.d/ssh restart * Restarting OpenBSD Secure Shell server sshd
复制代码
来源:https://blog.csdn.net/qq_39393772/article/details/108653556
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作! |