scp

SCP w/ ssh: copying a local file from windows to a remote server using scp

泪湿孤枕 提交于 2019-11-28 16:11:33
问题 So, I'm attempting to simply transfer folder of files from my local computer to a server via ssh and scp. After sudoing I'm using the command as follows: scp -r C:/desktop/myfolder/deployments/ user@host:/path/to/whereyouwant/thefile I get the error: ssh: C: Name or service not known I'm guessing its my syntax for c:/desktop etc. Any ideas? BTW I'm using putty + Windows 7. 回答1: If your drive letter is C, you should be able to use scp -r \desktop\myfolder\deployments\ user@host:/path/to

05 多linux通信

本秂侑毒 提交于 2019-11-28 13:26:34
文章目录 1 scp 2 SSH无密码登录 3 rsync 4 编写集群分发脚本 4.1 循环复制文件到所有节点的相同目录下 4.2 在所有主机上同时执行相同的命令 1 scp scp可以实现服务器与服务器之间的数据拷贝。 (1)将hadoop101中/opt/module和/opt/software文件拷贝到hadoop102、hadoop103和hadoop104上。 [root@hadoop101 /]# scp -r /opt/module/ root@hadoop102:/opt [root@hadoop101 /]# scp -r /opt/software/ 来源: https://blog.csdn.net/ashencode/article/details/100066296

Embedding the Password in the Bash Script

半城伤御伤魂 提交于 2019-11-28 12:56:22
问题 I am running a test script where files needs to be copied to the target embedded system.But when this command of copying the files to remote target system is run from the script I was prompted for the administrator password of the Target Board.How can I automate the script in such a way that the script will pick the password by itself(from within the script) and I don't have to put the password manually every-time i run the script. Snippet form the script is as below : scp test.file1 <Target

NFS服务和DHCP服务讲解

主宰稳场 提交于 2019-11-28 10:13:58
NFS服务端概述 NFS,是Network File System的简写,即网络文件系统。网络文件系统是FreeBSD支持的文件系统中的一种,也被称为NFS; NFS允许一个系统在网络上与他人共享目录和文件。 模式: C/S 模式 端口: NFS是Net File System的简写,即网络文件系统.NFS通常运行于2049端口。 部署NFS 由于在使用NFS服务进行文件共享之前,需要使用RPC(Remote Procedure Call,远程过程调用)服务将NFS服务器的IP地址和端口号等信息发送给客户端。因此,在启动NFS服务之前,还需要顺带重启 并启用rpcbind服务程序。 第一步:下载 [root@ken ~]# yum install rpcbind nfs-utils -y 第二步:编辑配置文件 [root@ken ~]# cat /etc/exports /ken 172.20.10.0/28(rw) /ken 172.20.10.7(rw) #给特定的ip共享,rw表示权限 /data *(rw) #给所有ip 共享 /data 172.20.10.0/28(rw) #把网段共享出去 28表示掩码 /data 172.20.10.0/28(rw) 192.168.64.0/24(rw) #设置多个网络 注意: * 表示对所有网段开放权限 nfs也可以共享多个目录

宿主机linux与docker的文件传递

▼魔方 西西 提交于 2019-11-28 08:02:20
文章目录 服务器上传、下载数据,docker数据库文件导入 一、与远程Linux服务器互传 1、从服务器上下载文件 2、上传本地文件到服务器 3、从服务器下载整个目录 4、上传目录到服务器 二、服务器作为宿主机与docker之间互传 1、见宿主机文件复制到docker 2、只针对sql文件(进行导入操作) 服务器上传、下载数据,docker数据库文件导入 一、与远程Linux服务器互传 在linux下一般用scp这个命令来通过ssh传输文件。 1、从服务器上下载文件 scp username@servername:/path/filename /var/www/local_dir(本地目录) # 例如 scp root@192.168.0.101:/var/www/test.txt # 把192.168.0.101上的/var/www/test.txt的文件下载到/var/www/local_dir(本地目录) 2、上传本地文件到服务器 scp /path/filename username@servername:/path # 例如scp /var/www/test.php root@192.168.0.101:/var/www/ # 把本机/var/www/目录下的test.php文件上传到192.168.0.101这台服务器上的/var/www/目录中 3

常用的linux命令大全

跟風遠走 提交于 2019-11-28 06:57:10
之前做过两年的运维,用过很多命令,深切体会到某些linux命令熟练掌握后对效率提升有多大。举个简单的例子,在做了研发后经常会有跑一些数据,对于结果数据的处理,我们的产品同学一般都习惯于用excel做统计,把数据复制到excel里,然后数据分列,排序………… 最后得出某些简单的结论,我只需要cat, sort, uniq, awk, grep 这几个命令挥手间完成相同的操作。   这里我总结下我工作这几年用过的一些命令,当然,这里就不提那些vim cd ls mv cp 这种简单的命令了,如果你都不会这些命令的话,建议你先学习下。这里命令很多,我只简单列出几个我常用的参数。其实很多命令我也用的不是特别多,这篇文章我也只是希望能让大家知道有这样一个工具,但具体用如果想继续深入了解的话建议查看下手册,部分比较命令我也列出了有些参考资料。 目录/文件处理命令 mkdir dirname 创建文件夹 mkdir -p /tmp/a/b 递归创建目录 rm -rf dirname 删除目录及内部文件 -r:表示递归删除文件及文件夹;-f:表示强制删除,不提示 touch filename 创建文件 mv ins.war ins_new.war 重命名 mv ins.war webapps/ 移动文件到指定目录 cp index.jsp index_new.jsp 复制并重命名 cp -r .

JSch SCP file transfer using “exec” channel

笑着哭i 提交于 2019-11-28 06:26:56
问题 I'm very new to the SCP protocol and JSch. I have to transfer a file fro a remote device via SCP to Android. The server side developers refused to tell be anything about their device except for the file location, and the root account which can be used to access it with SCP. Here are the steps I tried. Confirm that using JSch, my Android client can establish connection with the server. [complete] Confirm that using JSch, and the ChannelExec object, I can send the ls command and read its output

How to download a file from my server using SSH (using PuTTY on Windows)

泪湿孤枕 提交于 2019-11-28 05:40:32
When I try downloading a file from my server onto my computer, it actually downloads the file onto the server. (Note I am already SSH'd into my server before typing this command. I've watched tutorials on YouTube and people are using their terminal without SSHing into any particular server, however I don't think I can do this with PuTTY on Windows?) scp -r -P2222 kwazy@mywebsite.com:/home2/kwazy/www/utrecht-connected.nl ~/Desktop/ The problem is that I am specifying the location to download the file as only ~/Desktop/ This creates a folder called Desktop in my server, instead of copying the

Copy file from chef client node to workstation

假装没事ソ 提交于 2019-11-28 05:31:34
问题 I would like to know how to transfer a file from a client node to a remote machine. I have checked whether there any resource available for doing this. The closest thing I found is remote_file , but it is fetching a file from remote location and transfer it to the client node. So I tried another option by writing a bash script which will perform an automated scp. But I cant able to copy the file, but the chef-client was running fine without showing any errors. Here is my script for copying

Using putty to scp from windows to Linux

空扰寡人 提交于 2019-11-28 04:28:36
I'm trying to test some C code that I'm writing. The only issue is that the code needs to be executed on a remote machine. My laptop is pretty old, and there is no driver for my wireless card available for Ubuntu, so booting into Linux to circumvent this problem isn't an option. Here's my question: I'm using putty to SSH into the remote machine, and I'm writing my code on Notepad++. The location of my file is: C:\Users\Admin\Desktop\WMU\5260\A2.c My problem is that when I use the command scp C:\Users\Admin\Desktop\WMU\5260\A2.c ~ I get the error could not resolve hostname C:. Name or service