Rebex File Server
SFTP, SCP and SSH server library for .NET
Download 30-day free trial Buy from $349More .NET libraries
-
Rebex SFTP
.NET SFTP client
-
Rebex FTP
.NET FTP client
-
Rebex Total Pack
All Rebex libraries together
Back to feature list...
SCP server
On this page:
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
Back to feature list...