Rebex File Server

SFTP, SCP and SSH server library for .NET

Download 30-day free trial Buy from $349
More .NET libraries

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.

// 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 filesystem 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 filesystem 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 filesystem (just like the SFTP module). Supported commands include:

ls, dir, cd, pwd, mkdir, rmdir, cp, mv, echo, whoami, uname, hostname, set, exit

You can easily implement custom shell commands.

Compatible with popular SCP clients 

Our implementation of the scp command and the related shell commands is compatible with popular third-party SCP clients including WinSCP and OpenSSH's scp command.

Virtual shell can also be accessed by SSH clients such as PuTTY or OpenSSH's ssh command.

Back to feature list...