scp

How to scp with a second remote host

不问归期 提交于 2019-11-27 16:49:22
I wonder if there is a way for me to SCP the file from remote2 host directly from my local machine by going through a remote1 host. The networks only allow connections to remote2 host from remote1 host. Also, neither remote1 host nor remote2 host can scp to my local machine. Is there something like: scp user1@remote1:user2@remote2:file . First window: ssh remote1 , then scp remot2:file . . Second shell: scp remote1:file . First window: rm file; logout I could write a script to do all these steps, but if there is a direct way, I would rather use it. Thanks. EDIT: I am thinking something like

How to escape spaces in path during scp copy in Linux?

℡╲_俬逩灬. 提交于 2019-11-27 16:43:50
I'm new to linux, I want to copy a file from remote to local system... now I'm using scp command in linux system.. I have some folders or files names are with spaces, when I try to copy that file, it shows the error message: "No such file or directory" I tried: scp ael5105@192.168.0.200:'/home/5105/test/gg/Untitled Folder/a/qy.jpg' /var/www/try/ I saw the some reference online but I don't understand perfectly, can any one help on this? how can I escape spaces in file name or directory names during copying... Basically you need to escape it twice, because it's escaped locally and then on the

How does `scp` differ from `rsync`?

冷暖自知 提交于 2019-11-27 16:37:40
An article about setting up Ghost blogging says to use scp to copy from my local machine to a remote server: scp -r ghost-0.3 root@*your-server-ip*:~/ However, Railscast 339: Chef Solo Basics uses scp to copy in the opposite direction (from the remote server to the local machine): scp -r root@178.xxx.xxx.xxx:/var/chef . In the same Railscast, when the author wants to copy files to the remote server (same direction as the first example), he uses rsync : rsync -r . root@178.xxx.xxx.xxx:/var/chef Why use the rsync command if scp will copy in both directions? How does scp differ from rsync ? Rafa

How to copy directory via scp within gradle task?

*爱你&永不变心* 提交于 2019-11-27 16:11:15
问题 What is a clean and elegant way to copy a bunch of files via scp with Gradle? Two ways I currently see are: Using Apache Wagon, as described here: http://markmail.org/message/2tmtaffayhq25g4s Executing scp via command line with the Exec task Are there any better (more obvious) ways to approach this? 回答1: From a project of mine that I use to SCP files to an EC2 server. The jar files there are local files that are part of my project, I forget where I got them from. There's probably a more

使用scp在windows和Linux之间互传文件

╄→尐↘猪︶ㄣ 提交于 2019-11-27 15:44:39
【伍哥原创】 在做系统架构实验的时候,少不了碰到要在本地机和Linux服务器之间传东西,比如数据库文件等。 平时在Linux之间传个东西还是挺方便的,用过scp就okay了。如果能够在windows和linux之间也能这么方便的话就好了。 基于这样的想法,伍哥google了一把,发现了一个好东西:WinSSHD,就是让windows也支持ssh协议。 1,安装 WinSSHD 首先下载WinSSHD:http://123yun.newhua.com/down/WinSSHD5-Inst.zip 然后双击安装,安装的时候选择personal,就是个人使用,避免了30天后过期。 最后通过winsshd的面板启动ssh服务,如图: 2,测试scp在windows和Linux之间互传文件 先登录到你的Linux服务器,比如伍哥的是192.168.1.20。还有确认一下windows机器的IP,伍哥这边是192.168.1.30。 1 2 3 4 # windows -> linux scp administrator@192.168.1.30: /d : /mysql .sql ./ # linux -> windows scp . /install .log administrator@192.168.1.30: /d :/ 文件传输的时候,WinSSHD会产生悬浮提示。 来源:

linux远程拷贝命令及not a regular file 解决方案

谁说我不能喝 提交于 2019-11-27 15:27:45
linux 远程拷贝 :scp scp 文件名 root@远程ip:/路径/ 将本地home目录下的test.tar的文件拷贝到远程主机192.168.1.23的/home/adm/目录下,则命令为:scp /home/test.tar root@192.168.1.23:/home/adm/ 回车后输入密码就可以了 scp提供了几个选项 在scp后加就行了 -p 拷贝文件的时候保留源文件建立的时间。 -q 执行文件拷贝时,不显示任何提示消息。 -r 拷贝整个目录 www.2cto.com -v 拷贝文件时,显示提示信息。 linux 下scp传文件时错误 scp: /usr/tools: not a regular file 不能成功传送 解决方案 1:有可能没权限 chmod 777 2: 在使用scp时加上-r 参数 scp -r root@192.168.16.5:/usr/tools/xxxx 来源: https://www.cnblogs.com/qingqing1/p/11368362.html

windows 和 linux 服务器互传文件

放肆的年华 提交于 2019-11-27 15:16:51
Linux与Linux之间传送文件 使用scp命令。 windows与Linux之间传送文件 (1) 用putty的内置小组件PSCP.exe。(此法可行) pscp.exe 可从putty官方下载,然后放到 windows 的c:\windows\system32目录下,这样cmd 命令提示符窗口 输入pscp直接可执行了,pscp 选项有: -r 拷贝整个目录,可加 -r 选项 -p 拷贝文件的时候保留源文件建立的时间。 -q 执行文件拷贝时,不显示任何提示消息。 -v 拷贝文件时,显示提示信息 windows 上传文件 到 linux 步骤 :运行cmd,进入Pscp.exe所在目录。 输入命令: pscp -scp file username@hostIP:文件地址 例:pscp -scp -P port d:abc.txt endall@IP:/home/endall/abc.txt 上传指定文件夹下的内容: pscp -scp -r -P(大写) port d:\...\fileUpload\ user@IP:/home/user/ 可以新建一个批处理文件,这样就不用每次都输入命令及密码了。 @echo off pscp.exe -l user -pw password -scp -r -P port(放在最后,否则不能正常执行) ...\localfilepath\

linux远程拷贝及防火墙设置

≡放荡痞女 提交于 2019-11-27 15:12:36
系统文件: scp 远程copy命令: 从linux服务器A的/root/目录下拷贝文件MySQL-server-5.6.15-1.linux_glibc2.5.x86_64.rpm到linux服务器B的 /usr/local/目录: 登录服务器B,执行下面命令: scp AloginName@Alogin_ip:/remote/path /local/path 例如: [root@iZ287wlb695Z local]# scp root@138.139.122.132:/root/MySQL-server-5.6.15-1.linux_glibc2.5.x86_64.rpm /usr/local/ 切换到root用户 : su root vi编辑高亮标记查找 : 如查找文件中 的user_id 和 user_id = 2内容 (1) vi 文件名 (2) 使用 / (文件从上往下找) / user_id (高亮标记user_id) / user_id = 2 (高亮标记user_id = 2) 单独 按 N 键 ,进行下一个查找 (3 ) 使用 ? (文件从下往上找) ?user_id (高亮标记user_id) ?user_id = 2 (高亮标记user_id = 2) 单独 按 N 键 ,进行上一个查找 防火墙: redhat: LINUX关闭防火墙命令

How to copy a folder from remote to local using scp? [closed]

不想你离开。 提交于 2019-11-27 09:54:43
How to copy a folder from remote to local host using scp ? I use ssh to log in my server. Then, I would like to copy the remote folder foo to local /home/user/Desktop . How to achieve this? Gryphius scp -r user@your.server.example.com:/path/to/foo /home/user/Desktop/ From man scp (See online manual ) -r Recursively copy entire directories Alexander Yancharuk To use full power of scp you need to go through next steps: Public key authorisation Create ssh aliases Then, for example if you have this ~/.ssh/config : Host test User testuser HostName test-site.com Port 22022 Host prod User produser

Run local python script on remote server

青春壹個敷衍的年華 提交于 2019-11-27 06:25:27
I'm debugging some python script that must run on my virtual machine. And, I prefer to edit the scripts locally(outside of virtual machines). So I find it's tedious to scp modified scripts to virtual machines every time. Can anyone suggests some effective way? Particularly, I'm wondering if it's possible to execute python scripts on remote PVM. Something like that: python --remote user@192.168.1.101 hello.py //**FAKED**, served to explain ONLY It is possible using ssh. Python accepts hyphen(-) as argument to execute the standard input, cat hello.py | ssh user@192.168.1.101 python - Run python