ssh推送.py程序到CentOS7服务器端运行出现lost connection错误

(base) F:\workspace>dir
驱动器 F 中的卷是 新加卷
卷的序列号是 C2B9-6277
F:\workspace 的目录
2019/03/13 16:44 <DIR> .
2019/03/13 16:44 <DIR> ..
2019/03/13 16:47 <DIR> .idea
2019/03/13 10:11 <DIR> .ipynb_checkpoints
2019/03/10 23:04 2,554 deepLearning.py
2018/11/22 19:42 3,097 DTW.py
2019/03/09 18:12 43 fun_a.py
2019/03/09 18:15 59 fun_b.py
2019/03/10 16:41 <DIR> GitHub_web_download
2019/03/09 17:16 129 machine_learing.py
2019/03/10 16:46 <DIR> mnist
2019/03/10 11:45 6,272 ResNet.py
2018/11/14 19:21 200 run_readcsv.py
2019/03/12 16:26 4,353 study_day1.ipynb
2019/03/13 10:13 560 Untitled.ipynb
2019/03/13 12:45 675 Untitled1.ipynb
2015/04/16 05:07 83,672,117 vanet-trace-creteil-20130924-1700-1900.csv
11 个文件 83,690,059 字节
6 个目录 189,100,208,128 可用字节

(base) F:\workspace>python machine_learing.py
Finish job, result = 9999
This is Windows

# 使用ssh让192.168.1.191节点服务器代替计算
(base) F:\workspace>ssh jiangshan@192.168.1.191 python < machine_learing.py
The authenticity of host '192.168.1.191 (192.168.1.191)' can't be established.
RSA key fingerprint is 9c:2a:60:69:42:ed:dc:70:26:d0:60:1f:b3:ac:40:3b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.1.191' (RSA) to the list of known hosts.
jiangshan@192.168.1.191's password:
Finish job, result = 9999
This is Linux

# 把文件copy到192.168.1.191节点服务器上
(base) F:\workspace>scp {fun_a,fun_b}.py jiangshan@192.168.1.191:~/workspace/
Exception: STATUS_ACCESS_VIOLATION at eip=610723FF
eax=00000000 ebx=00010002 ecx=00000000 edx=00000003 esi=00DF0000 edi=001D0010
ebp=0063E6A8 esp=0063E650 program=C:\Program Files (x86)\OpenSSH\bin\ssh.exe, pid 10396, thread main
cs=0023 ds=002B es=002B fs=0053 gs=002B ss=002B
Stack trace:
Frame Function Args
0063E6A8 610723FF (00DF0000, 001D0010, 00010002, 616D1438)
0063E818 6104EE7E (616D1688, 00010002, 00000001, 00000000)
0063E878 6109AD3E (004286FB, 00010002, 00000011, 100EF0D0)
0063E898 6108DF2F (004286FB, 00000002, 00000011, 00000001)
0063ECC8 0042881B (0063ECF0, 00000000, 004104F5, 616D27EA)
0063ED98 0041058A (0063EE00, 0000004F, 00000000, 0063EE14)
0063EDB8 0040FD53 (0063EE00, 100EF6E8, 0063EE00, 0041B469)
0063EDE8 0041AA08 (00000000, 0063EE14, 0063EE00, 0040F7A4)
0063EE48 0040FBD8 (100E8F20, 616D27EA, 100E8C50, 004391B0)
0063F020 004023A0 (00000001, 616D2708, 100E00A8, 0063F078)
0063F060 61005F54 (0063F078, 00000002, 0063F0DC, 0063F088)
0063FF40 6100616B (00000000, 00000000, 00000000, 00000000)
End of stack trace
lost connection
===出错===
# ping一下远端主机
(base) F:\workspace>ping 192.168.1.191
正在 Ping 192.168.1.191 具有 32 字节的数据:
来自 192.168.1.191 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.1.191 的回复: 字节=32 时间=1ms TTL=64
来自 192.168.1.191 的回复: 字节=32 时间<1ms TTL=64
来自 192.168.1.191 的回复: 字节=32 时间<1ms TTL=64
192.168.1.191 的 Ping 统计信息:
数据包: 已发送 = 4,已接收 = 4,丢失 = 0 (0% 丢失),
往返行程的估计时间(以毫秒为单位):
最短 = 0ms,最长 = 1ms,平均 = 0ms
能ping通, 则说明是远端192.168.1.191主机的问题

(base) F:\workspace>

# 问题排查
# 1. 检查远程主机是否安装openssh-server服务

打开Xshell
(base) [jiangshan@localhost ~]$ ps -ef | grep sshd
root 7018 1 0 Mar12 ? 00:00:00 /usr/sbin/sshd -D
root 8296 7018 0 04:54 ? 00:00:00 sshd: jiangshan [priv]
jiangsh+ 8300 8296 0 04:54 ? 00:00:00 sshd: jiangshan@pts/0
jiangsh+ 8428 8301 0 05:22 pts/0 00:00:00 grep --color=auto sshd
发现已经安装了
查看防火墙服务状态
(base) [jiangshan@localhost ~]$ systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)

# 查看防火墙运行状态(是否开启关闭)
(base) [jiangshan@localhost ~]$ firewall-cmd --state
not running

# 2. CentOS7临时关闭防火墙
(base) [jiangshan@localhost ~]$ systemctl stop firewalld
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
Authentication is required to manage system services or units.
Authenticating as: root
Password:
==== AUTHENTICATION COMPLETE ===

# 3. CentOS7禁止开机启动防火墙
(base) [jiangshan@localhost ~]$ systemctl disable firewalld
==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-unit-files ===
Authentication is required to manage system service or unit files.
Authenticating as: root
Password:
==== AUTHENTICATION COMPLETE ===
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ===
Authentication is required to reload the systemd state.
Authenticating as: root
Password:
==== AUTHENTICATION COMPLETE ===
# CentOS7查看开放端口
(base) [jiangshan@localhost ~]$ firewall-cmd --list-ports
FirewallD is not running
###################### CentOS7开启80端口-tcp协议
### firewall-cmd --zone=public --add-port=80/tcp --permanent###

# 4. 目标服务器要开启权限: 每个人都有读写执行的权限
(base) [jiangshan@localhost ~]$ chmod 777 /home/jiangshan/workspace
(base) [jiangshan@localhost ~]$ ls
anaconda3 Anaconda3-2018.12-Linux-x86_64.sh workspace

(base) [jiangshan@localhost ~]$ whereis scp
scp: /usr/bin/scp /usr/share/man/man1/scp.1.gz

===在CentOS下用scp命令来通过ssh传输文件====
1、从服务器上下载文件
scp jiangshan@192.168.1.191:/path/filename /var/local_dir(本地目标目录)
例如: scp jiangshan@192.168.1.191:/~/hello.txt 把192.168.1.191上的/home/jiangshan/hello.txt 的文件下载到/var/local_dir(本地目标目录)
2、上传本地文件到服务器
scp /path/filename jiangshan@192.168.1.191:/path
例如: scp /var/test.txt jiangshan@192.168.1.191:/var/ 把本机/var/目录下的test.txt文件上传至192.168.1.191这台服务器上的/var/目录中
3、从服务器下载整个目录
scp -r jiangshan@192.168.1.191:/var/remote_dir(远程目录) /var/local_dir(本地目录)
例如:scp -r jiangshan@192.168.0.101:/var/test /var/
4、上传目录到服务器
scp -r local_dir jiangshan@192.168.1.191:remote_dir
例如:scp -r test jiangshan@192.168.1.191:/var/ 把当前目录下的test目录上传到服务器的/var/目录
PS:服务器要开启读写权限

用scp命令来通过ssh传输文件,ssh推送.py程序到CentOS7服务器端出现lost connection错误的更多相关文章

  1. ssh推送.py程序到服务器端运行

    C:\Users\jiangshan>ssh jiangshan@192.168.1.191jiangshan@192.168.1.191's password:Last login: Sun ...

  2. Linux SCP 命令: 利用SSH传输文件

    在linux下一般用scp这个命令来通过ssh传输文件. 1.从服务器上下载文件scp username@servername:/path/filename /var/www/local_dir(本地 ...

  3. 用scp这个命令来通过ssh传输文件

    小结: 1. upload files 到 ssh 服务器 localhost $ scp localfile root@172.20.34.**:~/remotepath 2. 从 ssh 服务器d ...

  4. 在linux下一般用scp这个命令来通过ssh传输文件

    在linux下一般用scp这个命令来通过ssh传输文件. 1.从服务器上下载文件scp username@servername:/path/filename /var/www/local_dir(本地 ...

  5. 利用SSH传输文件

    在linux下一般用scp这个命令来通过ssh传输文件. 1.从服务器上下载文件scp username@servername:/path/filename /var/www/local_dir(本地 ...

  6. ssh传输文件

    在linux下一般用scp这个命令来通过ssh传输文件. 1.从服务器上下载文件scp username@servername:/path/filename /var/www/local_dir(本地 ...

  7. linux与linux,linux与windows之间用SSH传输文件

    linux与linux,linux与windows之间用SSH传输文件linux与linux之间传送文件:scp file username@hostIP:文件地址    例: scp abc.txt ...

  8. 利用ssh传输文件 分类: 服务器搭建 Raspberry Pi 2015-04-12 18:47 58人阅读 评论(0) 收藏

    在linux下一般用scp这个命令来通过ssh传输文件. 1.从服务器上下载文件 scp username@servername:/path/filename /var/www/local_dir(本 ...

  9. [转]利用ssh传输文件

    利用ssh传输文件 http://www.cnblogs.com/jiangyao/archive/2011/01/26/1945570.html 在linux下一般用scp这个命令来通过ssh传输文 ...

随机推荐

  1. npm install、npm init、npm update、npm uninstall和package.json

    npm install 安装本地包 npm install <package_name>:这个命令将在当前目录中创建node_modules目录(如果尚不存在),并将该软件包下载到该目录. ...

  2. 如何迁移 ArcGIS Enterprise WebGIS( Portal Server DataStore )系统

    在部署ArcGIS Enterprise WebGIS系统的时候,往往由于后期系统的扩容需求,需要把已经部署好的组件迁移到其他服务器中. ArcGIS WebGIS系统涉及的软件组件有Portal S ...

  3. MySql 利用crontab实现MySql定时任务

    MySql 利用crontab实现MySql定时任务 by:授客 QQ:1033553122 适用平台 任意myslq版本数据库 操作方法 登陆到数据库系统所在的linxu系统 第一步:新建名为cro ...

  4. Expo大作战(六)--expo开发模式,expo中exp命令行工具,expo中如何查看日志log,expo中的调试方式

    简要:本系列文章讲会对expo进行全面的介绍,本人从2017年6月份接触expo以来,对expo的研究断断续续,一路走来将近10个月,废话不多说,接下来你看到内容,将全部来与官网 我猜去全部机翻+个人 ...

  5. Python笔记(十三):urllib模块

    (一)      URL地址 URL地址组件 URL组件 说明 scheme 网络协议或下载方案 net_loc 服务器所在地(也许含有用户信息) path 使用(/)分割的文件或CGI应用的路径 p ...

  6. go语言练习:幂、函授接收和返回参数、转义字符、变量和常量

    1.实现a^b次方 package main func main() { r2 := power1(2,4) println(r2) } func power1(a uint64, b uint64) ...

  7. @RequestMapping、@ResponseBody 和 @RequestBody 注解的用法与区别

    背景: 帮助同事解决文件上传的bug(文件上传成功,但是页面提示上传接口异常,数据的确是插入了),从前端layui页面找错误,然后浏览器调试,找了半天无果.layui文件上传格式code返回是数值,后 ...

  8. SQL Server客户端工具到底使用的是哪个provider呢?

    SQL Server客户端工具到底使用的是哪个provider呢? 转载自:http://blogs.msdn.com/b/apgcdsd/archive/2013/01/10/sql-server- ...

  9. Prometheus Node_exporter 之 FileSystem Detail

    FileSystem Detail /proc/filesystems 1. Filesystem space available type: GraphUnit: bytesLabel: Bytes ...

  10. windows下搭建Consul分布式系统和集群

    随着大数据时代的到来,分布式是解决大数据问题的一个主要手段,随着越来越多的分布式的服务,如何在分布式的系统中对这些服务做协调变成了一个很棘手的问题.我们在一个项目上注册了很多服务,在进行运维时,需要时 ...