scp

ssh连接linux服务器不断开- \"Write failed: Broken pipe\"

拟墨画扇 提交于 2019-11-29 03:18:09
我自己用阿里云的服务器的时候,发现ssh连上以后,一会不用就断掉了,非常不方便,服务端的系统是ubuntu. 查了些东西,原来可以去配置服务端的sshd,或者客户端的ssh,就行了. 1,配置服务器端sshd,这样所有连该服务器的会话都会产生效果 找到 /etc/ssh/sshd_config 添加一行 ClientAliveInterval 30 这样server端每30s就会向client端发送一个keep-alive包, 来保持连接 还可以加上一行,指定发送keep-alive包的最大次数 ClientAliveCountMax 60 如果发送keep-alive包次数达到60, 而客户端还没有反应,则server端的sshd断开连接 也就是如果什么都不操作,这个配置可以让连接保持30*60s , 30分钟 2,如果没有服务器权限,可以配置客户端ssh,这样对这个客户端发起的所有会话都会产生效果 找到 /etc/ssh/ssh_config 同样添加上面跟上面了两个差不多的参数 ServerAliveInterval ServerAliveCountMax 这样就是ssh向服务端sshd发送keep-alive包 3, 也可以指定某个特定的会话 ssh -o ServerAliveInterval=30 root@192.168.12.192 ssh带上 -o

one_day_one_linuxCmd---scp命令

瘦欲@ 提交于 2019-11-29 02:43:46
  《坚持每天学习一个 linux 命令,今天我们来学习 scp 命令》 scp 命令主要用在不同的 linux 系统之间 copy 文件,基于 ssh 登录,是一种安全的复制 scp 命令的基本格式: scp [options] source dest --从原路径 copy 文件到目的路径 options: -a : 尽可能将原文件状态、权限等资料都保持原状态进行复制,并且是递归复制 -r : 表示递归复制,若 source 中包含目录名,则将目录下的文件皆依序拷贝到目的地 -f : 表示 force,若目的地已经有同名的文件存在,则在复制前先予以删除再进行复制 1,从本地复制到远程: 待测试 来源: https://www.cnblogs.com/zpcoding/p/11441237.html

linux系统中scp命令的用法

我与影子孤独终老i 提交于 2019-11-28 21:43:05
scp是 secure copy的缩写, scp是 linux 系统下基于ssh登陆进行安全的远程文件拷贝命令。 linux 的scp命令可以在linux 服务器 之间复制文件和目录. scp命令的用处 : scp在网络上不同的主机之间复制文件,它使用ssh安全协议传输数据,具有和ssh一样的验证机制,从而安全的远程拷贝文件。 scp命令基本格式 : scp [-1246BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 [...] [[user@]host2:]file2 scp命令的参数说明 : -1 强制scp命令使用协议ssh1 -2 强制scp命令使用协议ssh2 -4 强制scp命令只使用IPv4寻址 -6 强制scp命令只使用IPv6寻址 -B 使用批处理模式(传输过程中不询问传输口令或短语) -C 允许压缩。(将-C标志传递给ssh,从而打开压缩功能) -p 保留原文件的修改时间,访问时间和访问权限。 -q 不显示传输进度条。 -r 递归复制整个目录。 -v 详细方式显示输出。scp和ssh(1)会显示出整个过程的调试信息。这些信息用于调试连接,验证和配置问题。 -c

SCP远程复制

情到浓时终转凉″ 提交于 2019-11-28 19:57:09
SCP远程复制 在将本章的重要内容之前,我们先来学几个小点: 第1点 配置主机名称: 1.打开Xshell 6软件连接虚拟机 2.输入vim /etc/sysconfig/network命令进入主机名称的配置文件 3.按下o键键入插入模式,插入HOSTNAME=http01和NETWROKING=yes这两行命令 4.输入wq命令保存退出后,再输入init 6重启后即可生效 第2点 添加DNS地址: 1.输入命令 vim /etc/resolv.conf命令进入DNS地址配置文件 2.输入echo “nameserver 8.8.8.8”>>/etc/resolv.conf即可添加DNS地址 3.输入cat /etc/resolv.conf即可查看添加结果 下面就是本章的主要内容了SCP远程复制: 1.输入vim /etc/hosts命令进入hosts文件 2.进入hosts文件后我们会看见两个本地地址,分别是IPv4和IP v6地址 3.插入多个地址 4.链接另一个虚拟机查看hosts文件 5.返回主虚拟机查看hosts文件 6.输入SCP命令远程复制 6.1希望把本地文件同步到其他服务器 格式:scp 本地同步文件路径 用户@ip:远程服务器文件路径 实操: 1.输入scp /etc/hosts root@192.168.195.129:/etc/hosts命令 2

大数据分布式集群搭建大全

試著忘記壹切 提交于 2019-11-28 17:52:23
系统准备 Centos6.5 Windows10 相关软件包下载: 链接:https://pan.baidu.com/s/1EOLUphwZgzwSX01HsDJM0g 提取码:1tsf 说明 特别说明: 教程用的主机名分别为master,slave1,slave2 所以发现有出现主机名为 ” spark1”的主机名 等同于 “master”如果如果看见配置文件为spark1,一定要修改成master ;有些图片是后面添加的才出现主机名不一致但并不影响理解. 没有特别说明操作都是在 master 机器操作 关闭防火墙 关闭Linux和Windows的防火墙(防止机器之间应为防火墙拦截而不能连通) Windows: window系统: 控制面板 -> 系统和安全 ->Windows Defender 防火墙 -> 启用或关闭Windows Defender 防火墙 -> 关闭Windows Defender 防火墙 //一般只关闭”专用网络设置”的防火墙就行 Linux: 停止防火墙: service iptables stop 启动防火墙: service iptables start 重启防火墙: service iptables restart 永久关闭防火墙: chkconfig iptables off 永久开启防火墙: chkconfig iptables no

Why is copying a directory with Ansible so slow?

元气小坏坏 提交于 2019-11-28 17:19:37
问题 I'm using Ansible to copy a directory (900 files, 136MBytes) from one host to another: --- - name: copy a directory copy: src={{some_directory}} dest={{remote_directory}} This operation takes an incredible 17 minutes, while a simple scp -r <src> <dest> takes a mere 7 seconds. I have tried the Accelerated mode, which according to the ansible docs "can be anywhere from 2-6x faster than SSH with ControlPersist enabled, and 10x faster than paramiko.", but to no avail. 回答1: TLDR: use synchronize

SCP doesn't work when echo in .bashrc?

霸气de小男生 提交于 2019-11-28 16:56:40
I have two users in Fedora: Wani root (quite obvious!) My contents of .bashrc of user Wani are: # .bashrc echo "Hello" # Source global definitions if [ -f /etc/bashrc ]; then . /etc/bashrc fi # User specific aliases and functions Now after logging into root, I type the following commands: [root@Dell Wani]# touch try.txt [root@Dell Wani]# service sshd start [root@Dell Wani]# scp try.txt Wani@localhost:~/ Wani@localhost's password: Hello [root@Dell Wani]# Now I log into Wani, and type: [Wani@Dell ~]$ cat try.txt cat: try.txt: No such file or directory [Wani@Dell ~]$ Now I again log into root and

Transfer files to/from session I'm logged in with PuTTY

我只是一个虾纸丫 提交于 2019-11-28 16:38:11
问题 I'm logged into a remote host using PuTTY. What is the command to transfer files from my local machine to the machine I'm logged into on PuTTY? 回答1: This is probably not a direct answer to what you're asking, but when I need to transfer files over a SSH session I use WinSCP, which is an excellent file transfer program over SCP or SFTP. Of course this assumes you're on Windows. 回答2: Click on start menu. Click run In the open box, type cmd then click ok At the command prompt, enter: c:>pscp

scp 命令

淺唱寂寞╮ 提交于 2019-11-28 16:26:38
NAME scp — secure copy (remote file copy program) SYNOPSIS scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file] [-l limit] [-o ssh_option] [-P port] [-S program] [[user@]host1:]file1 ... [[user@]host2:]file2 scp是secure copy的简写,用于在Linux下进行远程拷贝文件的命令,和它类似的命令有cp,不过cp只是在本机进行拷贝不能跨服务器,而且scp传输是加密的,可能会稍微影响一下速度。当你服务器硬盘变为只读 read only system时,用scp可以帮你把文件移出来。另外,scp不占资源,不会提高多少系统负荷,在这一点上,rsync就远远不及它了。虽然 rsync比scp会快一点,但当小文件众多的情况下,rsync会导致硬盘I/O非常高,而scp基本不影响系统正常使用。 1.命令格式: scp [参数] [原路径] [目标路径] 2.命令功能: scp是 secure copy的缩写, scp是linux系统下基于ssh登陆进行安全的远程文件拷贝命令。linux的scp命令可以在linux服务器之间复制文件和目录。 3.命令参数: -1

Single Line sftp from Terminal

亡梦爱人 提交于 2019-11-28 16:17:06
问题 Several times throughout the day, I may be running a test where I need to look through a log file on a remote server. I've gotten used to using my terminal to sftp into the remote server and pull the desired log file down to /tmp on my local machine. I was looking through the options today using man sftp in an attempt to figure out a way to run the following commands basically in a single line so that I don't have to type a command, press enter, type a command press enter, etc. (what I do now