scp

Scp through ssh tunnel opened

假装没事ソ 提交于 2019-11-30 21:09:06
问题 I want to send files from machineA which has opened a reverse tunnel with a server. The reverse tunnel connects port 22 on machineA with port 2222 on the server: autossh -M 0 -q -f -N -o "ServerAliveInterval 120" -o "ServerAliveCountMax 1" -R 2222:localhost:22 userserver@server.com If I do: scp file userserver@server.com:. then SCP sends the file with a new login over SSH, in my case using public/private key. But if I do: scp -P 2222 file userserver@localhost:. I get a "connection refused"

Using wildcards in file names using Python's SCPClient library

半腔热情 提交于 2019-11-30 20:53:18
问题 I want to copy files from remote machine using Python script to my local machine. I only know the extension of the file names so I want to use wildcards to express the file name. In addition, I want to use the SCPClient Python library and not the os.system directly as suggested in the question titled using wildcards in filename in scp in python But when I run the following code: from paramiko import SSHClient import paramiko from scp import SCPClient with SSHClient() as ssh: ssh.set_missing

工程师追查线上问题(或运维)常用的shell命令

落花浮王杯 提交于 2019-11-30 20:20:31
shell本身是非常强大的,而工程师在追查线上问题时,如何能够更加快速更加有效的定位问题,用好shell非常关键。下面是我总结的几个在追查问题时常用的shell命令。大家可以参考下。大家有好的命令,也可以在这之上完善。 1、日志分析类: (1) cut -d ‘’ -f4 wap_log |sort |uniq -c 比如cpu idle急剧下降,要看一下当前的流量如何,是否是由于流量突增引起。可以使用该命令: 其中wap_log是日志名,4 是时间那一列,简单介绍下这个shell命令。 这是一行实例日志行: 218.203.63.190 - - [09/Feb/2012:12:15:03 +0800] "GET /view/102795.html HTTP/1.1" 200 4557 "-" "MAUI WAP Browser" "jid=XKYGPzLXwG!70061790;$path=/" 76 在这个shell命令中,cut先根据空格分隔符对日志行进行分割,然后取第4个field,也就是时间,取到时间后,对时间进行排序,排序后,再去重,计数。这样就可以输出每个时间段的日志浏览量。 下面是改shell的输出实例: 18 [09/Feb/2012:12:54:51 14 [09/Feb/2012:12:54:52 11 [09/Feb/2012:12:54:53 10 [09

python paramiko

与世无争的帅哥 提交于 2019-11-30 18:09:58
下载文件 p_key = paramiko.RSAKey.from_private_key_file('id_rsa_path') scp = paramiko.Transport(server_ip, 22) scp.connect(username=ssh_username, pkey=p_key) sftp = paramiko.SFTPClient.from_transport(scp) sftp.get(src_file, tgt_file) 上传文件 p_key = paramiko.RSAKey.from_private_key_file('id_rsa_path') scp = paramiko.Transport(server_ip, 22) scp.connect(username=ssh_username, pkey=p_key) sftp = paramiko.SFTPClient.from_transport(scp) sftp.put(src_file, tgt_file) 来源: https://my.oschina.net/redhands/blog/3112553

scp & 进程管理 & 服务

半世苍凉 提交于 2019-11-30 15:12:45
SCP命令 -P为端口参数紧接端口参数,不要有空格,后面两个为文件路径,拷贝方向为从前向后,不区分本地与远端路径 远端路径格式:用户名@地址:远端路径 栗子: scp -P22000 ./clearLog.sh root@211.149.215.86:/root/taskBash SELinux ps -l 显示正在执行的前台程序 Tips:在执行命令的时候,尾部添加 & 该命令将会以后台形式进行执行 后台指令、切换管理 ctrl+z 前台指令运行中 可以使用 ctrl+z 将当前指令转至后台暂停 fg n 将ctrl+z放置到后台的程序唤醒回前台继续执行,n为暂停时出现的编号 bg n 将暂停的指令以后台形式继续运行,n为暂停时的编号 脱机运行程序 nohup 使用nohup指令, nohup不支持bash内建指令 ,所以请使用shellScript脚本执行,栗子 # & 后台运行 nohup ./test.bash & 执行后,会输出提示语,按一下回车即可回到前台,登出操作不会中断指令执行 进程管理 top : 动态查看进程信息,类似win下面的任务管理器,进入后shift+e可以切换存储显示单位 ps :显示进程列表相关信息 pstree :查看当前进程树 [root@www ~]# ps aux <==观察系统所有癿程序数据 [root@www ~]# ps -lA <=

Is there any way of having maven scp wagon work consistently on linux/mac/windows platform?

北城以北 提交于 2019-11-30 15:09:57
问题 Given the very poor documentation about scp/ssh and maven I tried different approaches, basically falling in two main categories: using scpexe wagon and scp wagon. Usually they both work without issue on both linux and mac, but on windows I never found a way to make it work on all machines. scpexe approach (after installing complete putty and adding to path) - settings.xml configuration: <server> <id>internal</id> <username>******</username> <password>*******</password> <configuration>

二进制安装k8s v1.12.7

为君一笑 提交于 2019-11-30 12:58:15
开篇 一、 虚拟机规划 1、 master 集群 IP 主机名 日期 / 时间同步 192.168.1.164 k8s2-master1 server 端 192.168.1.140 k8s2-master2 client 端 192.168.1.122 k8s2-master3 client 端 2 、 node 集群 IP 主机名 日期 / 时间同步 192.168.1.146 k8s2-node1 client 端 192.168.1.231 k8s2-node2 client 端 192.168.1.221 k8s2-node3 client 端 3 、 etcd 集群 IP 主机名 日期 / 时间同步 192.168.1.226 etcd1 client 端 192.168.1.228 etcd2 client 端 192.168.1.229 etcd3 client 端 二、 安装环境 系统版本: centos 7.6 (最简安装) 内核版本: 3.10.0-957.el7.x86_64 三、 安装前的准备工作 1、所有节点做时间主从同步 l 安装 ntp 服务 yum -y install ntp l 服务端(一台)安装 chrony 服务 yum -y install chrony l 修改配置文件 ( 在服务端操作,就是你需要同步的服务器 ) vi /etc

scp a folder to a remote system keeping the directory layout

大兔子大兔子 提交于 2019-11-30 12:13:50
I have a large directory tree with hundreds of nested sub-folders. I need to copy only 4 folders and their contents to a remote system, but I need to destination folder structure to be kept the same. E.G. ./test/sub1/subsub1/hello.txt ./test/sub1/subsub2/hello2.txt ./test/sub2/hello3.txt I want to copy ./test/sub1/subsub1/* to a target such as user@system:~/test/sub1/subsub1/* but I do not want to copy subsub2 or sub2. I have tried using scp as follows: scp -r ./test/sub1/subsub1 me@my-system:~/test/sub1/subsub1 The result: scp: /test/sub1/subsub1: No such file or directory I also tried: scp

linux远程传输文件最快方法

牧云@^-^@ 提交于 2019-11-30 09:56:06
a服务器向b服务器传输文件: 打开终端,先cd到a服务器需要传输文件的文件夹目录下 命令:scp ./文件(传输该目录下全部文件用*) 用户名@服务器地址(b):传输路径地址(传到某文件夹下的文件夹地址) 例如:scp ./* chucx@172.20.107.92:/home/chucx/train/ a服务器下载b服务器上文件(与传输文件命令恰好相反): 命令:scp 用户名@服务器地址(b):传输路径地址(传到某文件夹下的文件地址 (传输该目录下全部文件用*) ) ./文件夹 例如:scp chucx@172.20.107.92:/home/chucx/train/* ./(先cd到要保存的文件夹下) 来源: CSDN 作者: nice_evil 链接: https://blog.csdn.net/qq_32793161/article/details/78253894