Skip to main content

Pyfilesystem2 implementation for SSH/SFTP using paramiko

Project description

Source PyPI Travis Codecov Codacy Format License

Requirements

pyfilesystem2

PyPI fs

Source fs

License fs

six

PyPI six

Source six

License six

paramiko

PyPI paramiko

Source paramiko

License paramiko

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 an 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)

See also

  • fs, the core pyfilesystem2 library

  • fs.archive, enhanced archive filesystems for pyfilesystem2

  • fs.proxy, miscellaneous proxy filesystems for pyfilesystem2

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fs.sshfs-0.3.0.tar.gz (10.0 kB view details)

Uploaded Source

Built Distribution

fs.sshfs-0.3.0-py2.py3-none-any.whl (12.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file fs.sshfs-0.3.0.tar.gz.

File metadata

  • Download URL: fs.sshfs-0.3.0.tar.gz
  • Upload date:
  • Size: 10.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for fs.sshfs-0.3.0.tar.gz
Algorithm Hash digest
SHA256 79cbe87ab721708ba82052ac542dd28247e51d7906c1d2abc1e1139d7e83f91f
MD5 5ee25cae1689f461d63924560b701b37
BLAKE2b-256 c4cde7b03b314e1f621c218b2601ea57a1578c2c2fdf0ed8463fa5190c633ea3

See more details on using hashes here.

Provenance

File details

Details for the file fs.sshfs-0.3.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for fs.sshfs-0.3.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 f31fe7a57e3f0db7e87f7947fc0c3ed6b77a4453a629420030d167a8ae6576dc
MD5 5dafa22628a87c7534848da8de5ed160
BLAKE2b-256 bb3f6597687e4a2b3ce270bb37e927f0d0e59a8046cf645d3609d59c9f0185f1

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page