Pyfilesystem2 implementation for SSH/SFTP using paramiko
Project description
Requirements
fs |
|||
paramiko |
|||
six |
Installation
Install directly from PyPI, using pip
pip install fs.sshfs
Usage
Use fs.open_fs to open a filesystem with an SSH FS URL:
import fs
my_fs = fs.open_fs("ssh://user:password@host:port/resource")
with the following optional parts:
user: defaults to the current user
password: if none provided, passwordless authentification methods are used (either using public keys or no authentification to connect to the host)
port: defaults to the usual SSH port (port 22)
resource: defaults to the root directory ("/")
For a more granular way of connecting to a SSH server, use the fs.sshfs.SSHFS constructor, which signature is:
from fs.sshfs import SSHFS
my_fs = SSHFS(
host, # The name or adress of the SSH server
user=None, # an optional username, defaults to the current user
passwd=None, # an optional password, not needed if using a public key or
# an SSH server without authentification
pkey=None, # a `paramiko.PKey` object, used to connect with a
# specific key (undiscoverable key, etc.)
timeout=10, # The timeout of the connection, in seconds
# (None to disable)
port=22, # The port to which to connect, default to default SSH port
keepalive=10, # The interval of time between keepalive packets, in
# seconds (0 to disable)
compress=False # Compress the communications with the server
)
Once created, the SSHFS filesystem behaves like any other filesystem (see the Pyfilesystem2 documentation)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fs.sshfs-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec57606a7fd43faf44bbf02df2b78bd57a21eaf49e3bd0e28c5cdc56f6413f3e |
|
MD5 | f78ddf0b3d14980afdb78f98bb5bf1d1 |
|
BLAKE2b-256 | 74a3a844f9b26a9102734cc26e32952e60717bacaf05b2d64829eabc7df83c5a |