Files transferrer over shell protocol
Encyclopedia
Files transferred over Shell protocol (FISH) is a network protocol that uses Secure Shell
Secure Shell
Secure Shell is a network protocol for secure data communication, remote shell services or command execution and other secure network services between two networked computers that it connects via a secure channel over an insecure network: a server and a client...

 (SSH) or Remote Shell
Remote Shell
The remote shell is a command line computer program that can execute shell commands as another user, and on another computer across a computer network.The remote system to which rsh connects runs the rshd daemon...

 (RSH) to transfer files
File transfer
File transfer is a generic term for the act of transmitting files over a computer network or the Internet. There are numerous ways and protocols to transfer files over a network. Computers which provide a file transfer service are often called file servers. Depending on the client's perspective the...

 between computers and manage remote files.

The advantage of FISH is that all it requires on the server-side is an SSH or RSH implementation, Unix shell
Unix shell
A Unix shell is a command-line interpreter or shell that provides a traditional user interface for the Unix operating system and for Unix-like systems...

, and a set of standard Unix
Unix
Unix is a multitasking, multi-user computer operating system originally developed in 1969 by a group of AT&T employees at Bell Labs, including Ken Thompson, Dennis Ritchie, Brian Kernighan, Douglas McIlroy, and Joe Ossanna...

 utilities (like ls
Ls
In computing, ls is a command to list files in Unix and Unix-like operating systems. ls is specified by POSIX and the Single UNIX Specification.- History :An ls utility appeared in the original version of AT&T UNIX...

, cat
Cat (Unix)
The cat command is a standard Unix program used to concatenate and display files. The name is from catenate, a synonym of concatenate.- Specification :...

 or dd
Dd (Unix)
In computing, dd is a common Unix program whose primary purpose is the low-level copying and conversion of raw data. According to the manual page for Version 7 Unix, it will "convert and copy a file". It is used to copy a specified number of bytes or blocks, performing on-the-fly byte order...

). Optionally, there can be a special FISH server program (called start_fish_server) on the server, which executes FISH commands instead of Unix shell and thus speeds up operations.

The protocol was designed by Pavel Machek in 1998 for the Midnight Commander
Midnight Commander
GNU Midnight Commander is a free cross-platform orthodox file manager and a clone of Norton Commander originally created by Miguel de Icaza.Midnight Commander is licensed under the terms of the GNU General Public License.-Design:...

 software tool.

Protocol messages

Client sends text requests of the following form:

#FISH_COMMAND arguments...
equivalent shell commands,
which may be multi-line

Fish commands are all defined, shell equivalents may vary.
Fish commands always have priority: the server is expected to execute a fish command if it understands it. If it does not, however, it can try and execute a shell command.
When there is no special server program, Unix shell ignores the fish command as a comment and executes the equivalent shell command(s).

Server replies are multi-line, but always end with

### xyz

line. ### is a prefix to mark this line, xyz is the return code.
Return codes are superset to those used in ftp.
The codes 000 and 001 are special, their meaning depends on presence of server output before the end line.

Session initiation

The client initiates SSH or RSH connection with echo FISH:;/bin/sh as the command executed on remote machine. This should make it possible for the server to distinguish FISH connections from normal RSH or SSH.

The first two commands sent to the server are FISH and VER to negotiate FISH protocol, its version and extensions.

#FISH
echo; start_fish_server; echo '### 200'

#VER 0.0.2 <...>
echo '### 000'

The server may reply to VER command with a lines like
VER 0.0.0 <...>
### 200
which indicates supported version of the FISH protocol and supported extensions.

Implementations

  • Midnight Commander
    Midnight Commander
    GNU Midnight Commander is a free cross-platform orthodox file manager and a clone of Norton Commander originally created by Miguel de Icaza.Midnight Commander is licensed under the terms of the GNU General Public License.-Design:...

  • Lftp
    Lftp
    lftp is a command-line file transfer program for UNIX and Unix-like systems. It was written by Alexander Lukyanov, and is made available under the GNU General Public License....

  • fish:// KDE
    KDE
    KDE is an international free software community producing an integrated set of cross-platform applications designed to run on Linux, FreeBSD, Microsoft Windows, Solaris and Mac OS X systems...

     kioslave
    KIO
    KIO is part of the KDE architecture. It provides access to files, web sites and other resources through a single consistent API. Applications, such as Konqueror which are written using this framework can operate on files stored on remote servers in exactly the same way as they operate on those...

     (with konqueror
    Konqueror
    Not to be confused with the Conqueror web browser.Konqueror is a web browser and file manager that provides file-viewer functionality for file systems such as local files, files on a remote ftp server and files in a disk image. It is a core part of the KDE desktop environment...

     or dolphin
    Dolphin (software)
    Dolphin is a free and open source software file manager for and part of the KDE Software Compilation. It is the default file manager in the current version, KDE Software Compilation 4, and can be optionally installed on K Desktop Environment 3...

    )

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK