python ssh 登录服务器
import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('192.168.1.197', 22, 'root', '******')
stdin, stdout, stderr = ssh.exec_command('ls')
print (stdout.read())
ssh.close()
import paramiko
ssh = paramiko.SSHClient()
ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy())
ssh.connect('192.168.1.197', 22, 'root', '******')
stdin, stdout, stderr = ssh.exec_command('ls')
print (stdout.read())
ssh.close()
背景:公司因项目开发需要购置了两台主机。因为配置网络的大哥又是不在公司,但是又着急使用新主机。(旧的已经卡成狗腿了)急需解决问题,首先电脑刚插入网线又问题,不亮。只有一个网卡亮但是并不是Internet的网卡。其他四个网卡插入均不亮。换个网...
ubuntu:rm /etc/localtimeln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtimecentos echo "A...
因为主机时间没有自动同步有9.8s的误差。导致了出现负时间的问题首先手动校准时间ntpdate cn.pool.ntp.org开启时间自动更新服务systemctl start ntpd查看服务状态systemctl status ntpd...
服务启动、停止和重启service xxx start service xxx stopservice xxx ...
curPath=$(readlink -f "$(dirname "$0")") echo $curPath #或者 curPath=$(dirname $(readli...
给自己的程序添加开机自启写了个脚本添加,并把执行脚本命令添加到了卡机启动中/etc/rc.local (不是一个设置开机启动的好办法)开机的时候存在失败,因为依赖的服务可能还没启动脚本就启动了 只能在脚本最上面sleep...