rysnc,scp与bashrc冲突问题

问题是:

scp file [email protected]: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.

时间: 2024-07-31 09:10:00

rysnc,scp与bashrc冲突问题的相关文章

Apache Spark源码走读之12 -- Hive on Spark运行环境搭建

欢迎转载,转载请注明出处,徽沪一郎. 楔子 Hive是基于Hadoop的开源数据仓库工具,提供了类似于SQL的HiveQL语言,使得上层的数据分析人员不用知道太多MapReduce的知识就能对存储于Hdfs中的海量数据进行分析.由于这一特性而收到广泛的欢迎. Hive的整体框架中有一个重要的模块是执行模块,这一部分是用Hadoop中MapReduce计算框架来实现,因而在处理速度上不是非常令人满意.由于Spark出色的处理速度,有人已经成功将HiveQL的执行利用Spark来运行,这就是已经非常

linux终端terminal个性化配置(转)

http://blog.csdn.net/pipisorry/article/details/39584489 {本文介绍Linux终端字体颜色设置.终端提示符显示内容设置.自定义alias命令} linux打开终端快捷键: ctrl + alt + t  新窗口中打开 ctrl + shift +t 新标签页中打开 个人配置文件介绍 系统默认状态下的终端显示为紫底白字(皮皮的linux为ubuntu 14.04 LTS) 在没有经过自定义配置的终端下因为所有输入输出都是一个颜色(ls命令除外)

安装SPARK和SCALA

1.下载 spark http://mirrors.cnnic.cn/apache/spark/spark-1.3.0/spark-1.3.0-bin-hadoop2.3.tgz 2.下载scala http://www.scala-lang.org/download/2.10.5.html 3.安装scala mkdir /usr/lib/scala tar –zxvf scala-2.10.5.tgz mv scala-2.10.5 /usr/lib/scala 4.设置scala路径 vi

大数据之一:Hadoop2.6.5+centos7.5三节点大数据集群部署搭建

一. VM虚拟环境搭建(详细讲解) 说明:在windos10上使用VmWare Workstation创建3节点Hadoop虚拟环境创建虚拟机下一步设置虚拟机主机名和介质存放路径设置20G磁盘大小选择"自定义硬件"配置网络模式为NAT模式配置虚拟机启动镜像到这里,使用虚拟机克隆技术配置另外两台slave 同理克隆slave2, 步骤省略 此时windos网络连接里面会出现两张虚拟网卡 接下来就是给虚拟机配置IP网络 虚拟机网卡IP要和NAT模式的IP是在同一个段,虚拟机才能通过wind

error:opencv有两个版本引起冲突

有多个warning出现...版本冲突 解决办法: cv_bridge[opncv和ros连接起来的桥],默认依赖的oencv版本是2.4.8,如果安装了新的opencv版本,比如3.1.0,那么在编译cv_bridge时候会提示无法找到opencv 2.4.8.so的库. 1.必须要先把旧版本的cv_bridge卸载掉: sudo apt-get remove ros-indigo-cv-bridge 2.然后下载新版本的cv_bridge: git clone https://github.

scp命令详解

先说下常用的情况: 两台机器IP分别为:A.104.238.161.75,B.43.224.34.73. 在A服务器上操作,将B服务器上/home/lk/目录下所有的文件全部复制到本地的/root目录下,命令为:scp -r [email protected]:/home/lk /root. 具体过程为: [[email protected] ~]# scp -r [email protected]43.224.34.73:/home/lk /root [email protected]43.2

【转】scp命令详解

先说下常用的情况: 两台机器IP分别为:A.104.238.161.75,B.43.224.34.73. 在A服务器上操作,将B服务器上/home/lk/目录下所有的文件全部复制到本地的/root目录下,命令为:scp -r [email protected]:/home/lk /root. 具体过程为: [[email protected] ~]# scp -r [email protected]:/home/lk /root [email protected]'s password: k2.

记录一奇葩scp问题的分析与解决过程

引 入 linux是一个庞大复杂的系统.整天跟它打交道的运维或开发人员难免不遇到什么问题.这里,本人聊聊遇到的一个跟scp相关的奇葩问题. 一.问题描述 两台centos6.7主机(主机一:172.16.13.62和主机二:172.16.13.72),都安装好ssh,相关的ssh连接配置也没问题,但是在用scp进行两主机之间的文件传输复制时,出现以下情况: 在主机一上操作scp,成功从主机二传输文件到主机一.当然也能成功把文件从主机一成功传输到主机二.如: [[email protected] 

Centos下关于ssh、scp与rsync设置与应用

最近应公司要求,需要对文件数据进行远程传输与备份操作,特此写了一篇文章记录下了关于ssh.scp以及rsync的应用配置全过程,可能过程太过罗嗦,但主要就是想在不遗漏每个过程的情况下对此进行阐述,希望大家能够体谅.当然类似的文章还有很多,本文仅以个人的名义来写的,不喜勿喷!如果文章中有什么错误的地方还请各位大神多多指点!万分感谢!一.ssh在文件共享里面的应用这个ssh可不仅仅是一个远程登录的一个服务,其实呢!它包括了几个组件:ssh(远程登录).sftp(文件共享[类似FTP]).scp(文件