You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Rsync and sftp doesn't work when remote host uses fish shell #3473
I tested on two hosts. First host is Debian Jessie (fish, version 2.2.0) and second is Maui Linux (fish, version 2.3.1).
sftp
sftp root@remoteHost
root@remoteHost's password:
Received message too long 539831597
part of log auth.log
Accepted password for root from localHost port 48460 ssh2
Oct 18 19:18:59 bpi sshd[7502]: pam_unix(sshd:session): session opened for user root by (uid=0)
Oct 18 19:19:00 bpi sshd[7502]: Received disconnect from localHost: 11: disconnected by user
Oct 18 19:19:00 bpi sshd[7502]: pam_unix(sshd:session): session closed for user root
rsync:
~ $ sudo rsync -av --delete -e ssh /home/pawel pawel@remoteHost:/mnt/backup
[sudo] hasło użytkownika pawel:
pawel@remoteHost's password:
protocol version mismatch -- is your shell clean?
(see the rsync man page for an explanation)
rsync error: protocol incompatibility (code 2) at compat.c(176) [sender=3.1.1]
I read manual and Internet and I executed the command
"ssh pawel@RemoteIP /bin/true > out.dat"
file "out.dat" contain result of script runned on login.
When I comment out link to script in file /etc/fish/config.fish, everything works correctly.
Works for me. This type of failure is usually caused by the shell config files writing to stdout when the session isn't interactive. In the case of fish you should ensure that anything in your ~/.config/fish/config.fish (and scripts it sources) that might write to stdout (or read from stdin but that's less common) is wrapped in a if status --is-interactive ... end block.
Reacted by Carina, Jio, Oskar Persson, Dennis M. Pöpperl, MedTech, dosensuppe and Mike Rivnak
Thanks a lot for your help. I put something like this
if status --is-interactive
/path/to/script/which/print/on/console
end
into /etc/fish/config.fish and works perfectly. Script is running only when shell is invoked by user, not by script.
I tryed to put "if" inside script,. but I don't know how to mix bash script and fish script.
Activity
krader1961 commentedon Oct 18, 2016
Works for me. This type of failure is usually caused by the shell config files writing to stdout when the session isn't interactive. In the case of fish you should ensure that anything in your ~/.config/fish/config.fish (and scripts it sources) that might write to stdout (or read from stdin but that's less common) is wrapped in a
if status --is-interactive...endblock.pawlosck commentedon Oct 18, 2016
Thanks a lot for your help. I put something like this
into /etc/fish/config.fish and works perfectly. Script is running only when shell is invoked by user, not by script.
I tryed to put "if" inside script,. but I don't know how to mix bash script and fish script.
cdluminate commentedon Jul 4, 2017
Why not put this hint to FAQ? I've suffered from this problem for a time, being unable to use rsync with fish shell.