rysnc,scp与bashrc冲突问题
问题是:
scp file user@host:dst失败,user用户的bashrc文件中加入了 sudo su -,自动切换到root用户。
症状是输入密码验证失败。
rsync, scp是传输文件的工具,会用到stdin和stdout。
login bash会自动执行bashrc中的命令,如果bashrc的命令会输出内容到stdout,需要要求是clean bash。
参考https://rsync.samba.org/FAQ.html#3
is your shell clean
The "is your shell clean" message and the "protocol mismatch" message are usually caused by having some sort of program in your .cshrc, .profile, .bashrc or equivalent file that writes a message every time you connect using a remote-shell program (such as ssh or rsh). Data written in this way corrupts the rsync data stream. rsync detects this at startup and produces those error messages. However, if you are using rsync-daemon syntax (host::path or rsync://) without using a remote-shell program (no --rsh or -e option), there is not remote-shell program involved, and the problem is probably caused by an error on the daemon side (so check the daemon logs).
A good way to test if your remote-shell connection is clean is to try something like this (use ssh or rsh, as appropriate):
ssh remotesystem /bin/true > test.dat
That should create a file called test.dat with nothing in it. If test.dat is not of zero length then your shell is not clean. Look at the contents of test.dat to see what was sent. Look at all the startup files on remotesystem to try and find the problem.
rysnc,scp与bashrc冲突问题的更多相关文章
- linux终端terminal个性化配置(转)
http://blog.csdn.net/pipisorry/article/details/39584489 {本文介绍Linux终端字体颜色设置.终端提示符显示内容设置.自定义alias命令} l ...
- Apache Spark源码走读之12 -- Hive on Spark运行环境搭建
欢迎转载,转载请注明出处,徽沪一郎. 楔子 Hive是基于Hadoop的开源数据仓库工具,提供了类似于SQL的HiveQL语言,使得上层的数据分析人员不用知道太多MapReduce的知识就能对存储于H ...
- Hive on Spark运行环境搭建
Hive是基于Hadoop的开源数据仓库工具,提供了类似于SQL的HiveQL语言,使得上层的数据分析人员不用知道太多MapReduce的知识就能对存储于Hdfs中的海量数据进行分析.由于这一特性而收 ...
- 虚拟机搭建hadoop环境
这里简单用三台虚拟机,搭建了一个两个数据节点的hadoop机群,仅供新人学习.零零碎碎,花了大概一天时间,总算完成了. 环境 Linux版本:CentOS 6.5 VMware虚拟机 jdk1.6.0 ...
- Hadoop2.0环境安装
0. Hadoop源码包下载 http://mirror.bit.edu.cn/apache/hadoop/common 1. 集群环境 操作系统 CentOS7 集群规划 Master 192.16 ...
- Hadoop3集群搭建之——安装hadoop,配置环境
接上篇:Hadoop3集群搭建之——虚拟机安装 下篇:Hadoop3集群搭建之——配置ntp服务 Hadoop3集群搭建之——hive安装 Hadoop3集群搭建之——hbase安装及简单操作 上篇已 ...
- nginx 为什么要反向代理 影藏后端 高效连接(给nginx,他自己返回) 端口冲突解决 多个服务
nginx 为什么要反向代理 影藏后端 高效连接(给nginx,他自己返回) 端口冲突解决 多个服务 单机使用反向代理可以根据不同url匹配到不同站点 rsync 的工作原理和应用实例 ...
- git & scp
git & scp command : git & scp git git 提交 git checkout/pull =====[在提交前校验远程是否有冲突] git add [< ...
- Centos下关于ssh、scp与rsync设置与应用
最近应公司要求,需要对文件数据进行远程传输与备份操作,特此写了一篇文章记录下了关于ssh.scp以及rsync的应用配置全过程,可能过程太过罗嗦,但主要就是想在不遗漏每个过程的情况下对此进行阐述,希望 ...
随机推荐
- Python读写文件模式
1.r 打开只读文件,该文件必须存在. 2.r+ 打开可读写的文件,该文件必须存在. 3.w 打开只写文件,若文件存在则文件长度清为0,即该文件内容会消失.若文件不存在则建立该文件. 4.w+ 打开可 ...
- servelt乱码问题(tomcat服务端编码为ISO-8859-1)
Post的编码决定机制: <meta http-equiv="Content-Type" content="text/html; charset=gb2312&qu ...
- App抓包数据包之Paros的安装及使用
1.在应用程序开发过程中,会遇到很多网络访问问题,自己没有能力提供后台服务,这时就可以抓取网络上的数据包,获取数据接口,应用在程序中.下面介绍使用paros抓取网络数据包得步骤. 2.要使用paros ...
- 从XML文件乱码问题,探寻其背后的原理
出现应用程序读取XML文件乱码的场景: 加入xml文件以<?xml version="1.0" encoding="utf-8" ?> 格式的:如果 ...
- Android的minSdkVersion,targetSdkVersion,maxSdkVersion
参考http://developer.android.com/guide/topics/manifest/uses-sdk-element.html API Level 是一个整型值,表示Androi ...
- UML学习之类图
參考链接: http://www.uml.org.cn/oobject/201211231.asp 深入浅出UML http://www.open-open.com/lib/view/open132 ...
- Android--图片的三级缓存策略
三级缓存缓存(内存)--->本地磁盘---->网络1.首先看一下图片存储到本地磁盘 public class FileUtils { String path;//文件存储的地方 publi ...
- XML的四种解析方式
本文描述了构建良好的XML需要遵循的规则.作者详细介绍了构建XML需要考虑的元素,如何命名约定.正确的标记嵌套.属性规则.声明和实体,以及DTD和schema的验证,十分便于新手开始学习了解XML. ...
- log4j 日志的初始化
log4j 不指定时,log4j 会默认进行初始化,如果想要制定log4j.properties的位置时,可以进行指定: PropertyConfigurator.configure(): 参数里面加 ...
- Hibernate实体对象三种状态
Hibernate实体对象生命周期: 1. 自由状态(Transient,临时状态,瞬态) 在内存中自由存在,与数据库无关,未被Hibernate的Session管理 2. 持久状态(Persiste ...