Back to feature list...
SCP server
In addition to SFTP, Rebex File Server supports SCP,
a legacy file transfer mechanism based on scp command.
SCP is widely supported on Unix-like platforms.
Launching an SCP server
Simply create an instance of
FileServer,
bind it to a port, add a private key and at least one user with a path to their root directory.
Then start it, and the fully working SCP server is ready:
// create a server instance
var server = new FileServer();
// bind virtual shell with SCP support (runs over SSH) to port 22
server.Bind(22, FileServerProtocol.Shell);
// load a server private key from encrypted 'serverkey.ppk' file
server.Keys.Add(new SshPrivateKey("server-key.ppk", "password"));
// add a user (specify username, password and virtual root path)
server.Users.Add("user01", "password", @"c:\data\user01");
// start the server in the background
server.Start();
' create a server instance
Dim server = New FileServer()
' bind virtual shell with SCP support (runs over SSH) to port 22
server.Bind(22, FileServerProtocol.Shell)
' load a server private key from encrypted 'serverkey.ppk' file
server.Keys.Add(New SshPrivateKey("server-key.ppk", "password"))
' add a user (specify username, password and virtual root path)
server.Users.Add("user01", "password", "c:\data\user01")
' start the server in the background
server.Start()
See also
Virtual shell
Unlike SFTP, SCP doesn't provide a full remote file system API. On the contrary, it only supports basic file-transfer operations such as upload and download of a file or directory.
To overcome this limitation, other shell commands are often used in addition to scp when accessing a remote file system using SCP.
To address this scenario, our SCP module provides a virtual SSH shell that supports a subset of common Unix shell commands and only provides access
to the current user's virtual file system (just like the SFTP module). Supported commands include:
ls, dir, cd, pwd, mkdir, rmdir, cp, mv,
echo, whoami, uname, hostname, set, exit
Back to feature list...