scp

Ant scp task: JSchException: invalid privatekey [duplicate]

徘徊边缘 提交于 2020-01-03 07:03:05
问题 This question already has answers here : “Invalid privatekey” when using JSch (3 answers) Closed 10 months ago . I created a new key pair using ssh-keygen and added the public key on the server. Using sftp -i private_key_file user@server I can successfully open a connection to the server and put files. However, when I try to use the Ant scp task I receive: com.jcraft.jsch.JSchException: invalid privatekey: [B@5e9d5728 The relevant part of the Ant script: <scp file="local-file.zip" trust="true

Python: Execute scp, stdin for password not working

☆樱花仙子☆ 提交于 2020-01-03 03:34:14
问题 I'm trying the following from subprocess import Popen, PIPE Popen(["scp", "-B","user@url:file", "."], stdin=PIPE, shell=False).communicate(input="password") But I still get the password promt, and no password is sent. I know I can use scp with keys, but this is not what I need. Any help? 回答1: scp interacts with the terminal directly, rather than reading from STDIN , You can't pass the password via a pipe, it security matter for scp and it's the same for sftp, ssh. you can try it in you

How to sync Hadoop configuration files to multiple nodes?

北城以北 提交于 2020-01-03 02:54:51
问题 I uesd to manage a cluster of only 3 Centos machines running Hadoop. So scp is enough for me to copy the configuration files to the other 2 machines. However, I have to setup a Hadoop cluster to more than 10 machines. It is really frustrated to sync the files so many times using scp . I want to find a tool that I can easily sync the files to all machines. And the machine names are defined in a config file, such as: node1 node2 ... node10 Thanks. 回答1: If you do not want to use Zookeeper you

sshpass not working properly

◇◆丶佛笑我妖孽 提交于 2020-01-02 04:35:48
问题 I'm using sshpass to pass the password non-interactive on ubuntu 11.04. when I use sshpass with scp sshpass -p '123' scp sayuj@192.168.1.51:/home/sayuj/examples.desktop ~/Desktop/ it works fine but it doesn't work with ssh sshpass -p '123' ssh sayuj@192.168.1.51 What could be the problem and how do I fix it? 回答1: I found a solution: The problem is that the new version of ssh client still has and old version of sshpass (from 2008 not changed). You can find the patch here sshpass source All

linux scp命令

时间秒杀一切 提交于 2020-01-01 01:17:50
1、实践 本机11.160.50.10 scp -r /opt/scripts/qtt root@11.160.50.11:/opt/scripts/qtt 前提需要把50.10的公钥拷贝到50.11的公钥目录下,10.160.500.11中目录/opt/scripts/qtt可以不存在,拷贝后自动生成, 从远方拷到自己: scp -r root@43.224.34.73:/home/lk /root 从自己拷到远方: scp -r /root/lk root@43.224.34.73:/home/lk/cpfile 2、详解: 先说下常用的情况: 两台机器IP分别为:A.104.238.161.75,B.43.224.34.73。 在A服务器上操作,将B服务器上/home/lk/目录下所有的文件全部复制到本地的/root目录下,命令为:scp -r root@43.224.34.73:/home/lk /root。 具体过程为: [root@XX ~]# scp -r root@43.224.34.73:/home/lk /root root@43.224.34.73's password: k2.sql 100% 0 0.0KB/s 00:00 k.zip 100% 176 0.2KB/s 00:00 .bash_history 100% 32 0.0KB/s 00:00

软件测试学习LINUX常用命令

时光总嘲笑我的痴心妄想 提交于 2019-12-31 22:49:27
liunx通常用作服务器,运行服务器软件,服务器要等待,类似超市 学关键命令操作 内核,外壳 shell命令跟内核打交道 用的是发行版本,不是内核,Radhat公司的CentOS,阿里巴巴也用这个 liunx通常用来做服务器,各种各样的服务器, 用来保存文件的叫FTP服务器 用来放网站的叫Web网站服务器, 用来远程登录的叫远程登录服务器 用来做数据库系统叫数据库服务器 QQ要连腾讯电脑服务器,服务器类似超市,超市是固定的,提供服务 客户要下载,就放文件;客户要上网,就放网站 就放数据库 部署数据库,Tomcat部署,用户操作,网络操作,文件操作,创建文件夹,创建文档,打开我的电脑 跟Window一样,Window用界面,linux用命令跟cmd进去的DOS命令一样 日期命令,linux内核版本查看 管理,安装,卸载,硬件知识:网络IP地址,版本信息,硬件信息,内核信息 软件知识:电脑有多少用户,可以创建多用户,查看内容,ls可以查看文件,文件是谁,文件长度 测试之前要启动它吧,启动服务器,启动失败了,vim工具查看日志文件,配置文件,找到要命令,要改它也要命令 保存,或者退出,服务器配置信息都不知道,都登录不进去,能进行测试吗 CentOS(Community Enterprise Operating System,中文意思是:社区企业操作系统)是Linux发行版之一

How to use Remote-SSH in Windows

回眸只為那壹抹淺笑 提交于 2019-12-30 07:02:26
对于不太会使用 Vim 的我来说,在服务器上用 Vim 去修改 nginx.conf 实在有点麻烦,比如没有高亮和格式化。正好想起前不久微软发布了远程开发工具包,其中一个就是今天要介绍的 Remote-SSH。下面是官方对该扩展的定义: The Remote - SSH extension lets you use any remote machine with a SSH server as your development environment. This can greatly simplify development and troubleshooting in a wide variety of situations. 因此用来修改 nginx.conf 也是符合其目标的。 执行环境 Windows 10 Powershell Core 6.2.0 Visual Studio Code Insiders:因为 Remote-SSH 还在 Preview 阶段,只能开发版的 VSCode 中使用。 远程 Linux 主机 使用方法 在 Remote-SSH 扩展的介绍页面下其实是有一个 快速开始文档 的,简单来说就是在成功安装该扩展之后,需要配置服务端和本地客户端的环境。 在服务器上安装 SSH 服务 同样有 文档 : Debian / Ubuntu Run sudo

linux 从一台机器复制文件到另一台linux机器上去

纵然是瞬间 提交于 2019-12-29 00:31:05
1、功能说明 scp就是security copy,用于将文件或者目录从一个Linux系统拷贝到另一个Linux系统下。scp传输数据用的是SSH协议,保证了数据传输的安全,其格式如下: scp 远程用户名@IP地址:文件的绝对路径 本地Linux系统路径 scp 本地Linux系统文件路径 远程用户名@IP地址:远程系统文件绝对路径名 scp使用第一种格式是将远程Linux系统上的某个文件或者目录拷贝到本地Linux系统上来,使用第二种是将本地的某个文件或者目录拷贝到远程Linux系统的某个路径下。 2、举例 (1)目前我们处在IP为“192.168.60.133”的Linux系统下,计划将系统下的/home/ixdba/etc.tar.gz文件拷贝到IP为“192.168.60 168”的远程Linux系统中root用户下的/tmp目录下: scp /home/ixdba/etc.tar.gz root@192.168.60.168:/tmp 命令输入完毕,会要求输入“192.168.60.168”服务器root的密码,然后开始远程拷贝数据。 如果我们处在“192.168.60.168”服务器上,也可以使用下面的命令传输数据: scp root@192.168.60.133:/home/ixdba/etc.tar.gz /tmp 命令输入完毕,此时会要求输入“192.168

Linux复制文件scp

筅森魡賤 提交于 2019-12-29 00:26:52
cp 复制文件 (copy)   cp sourcefile destfile scp 跨服务器复制 (secure copy) (1) 复制文件:     scp local_file remote_username@remote_ip:remote_folder   或     scp local_file remote_username@remote_ip:remote_file   或     scp local_file remote_ip:remote_folder   或     scp local_file remote_ip:remote_file   第1,2个指定了用户名,命令执行后需要输入密码,第1个仅指定了远程的目录,文件名字不变,第2个指定了文件名   第3,4个没有指定用户名,命令执行后需要输入用户名和密码,第3个仅指定了远程的目录,文件名字不变,第4个指定了文件名 scp -r 复制目录 :     scp -r local_folder remote_username@remote_ip:remote_folder   或者     scp -r local_folder remote_ip:remote_folder   第1个指定了用户名,命令执行后需要输入密码;   第2个没有指定用户名,命令执行后需要输入用户名和密码

两台linux之间传输文件

╄→尐↘猪︶ㄣ 提交于 2019-12-29 00:25:28
scp传输 当两台LINUX主机之间要互传文件时可使用SCP命令来实现 scp传输速度较慢,但使用ssh通道保证了传输的安全性 复制文件 将本地文件拷贝到远程 scp local_file remote_username@remote_ip:remote_folder 或者 scp local_file remote_username@remote_ip:remote_file 或者 scp local_file remote_ip:remote_folder 或者 scp local_file remote_ip:remote_file 第1,2个指定了用户名,命令执行后需要再输入密码,第1个仅指定了远程的目录,文件名字不变,第2个指定了文件名; 第3,4个没有指定用户名,命令执行后需要输入用户名和密码,第3个仅指定了远程的目录,文件名字不变,第4个指定了文件名; 从远程将文件拷回本地 从远程复制到本地,只要将从本地复制到远程的命令的后2个参数调换顺序即可 复制目录 将本地目录拷贝到远程 scp -r 目录名 用户名@计算机IP或者计算机名称:远程路径 从远程将目录拷回本地 scp -r 用户名@计算机IP或者计算机名称:目录名 本地路径 命令格式 scp -r local_folder remote_username@remote_ip:remote_folder 或者 scp