Skip to main content

Pyfilesystem2 over SSH using paramiko

Project description

Source PyPI Conda 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

Opener

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]/[directory]")

VThe following URL parameters are supported: timeout, keepalive.

Constructor

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, user=None, paswd=None, pkey=None, timeout=10, port=22,
  keepalive=10, compress=False, config_path='~/.ssh/config'
)

with each argument explained below:

host

the name or IP address of the SSH server

user

the username to connect with, defaults to the current user.

passwd

an optional password, used to connect directly to the server or to decrypt the public key, if any given.

pkey

a paramiko.PKey object, a path, or a list of paths to an SSH key.

timeout

the timeout, in seconds, for networking operations.

port

the port the SSH server is listening on.

keepalive

the interval of time between keepalive packets, in seconds. Set to 0 to disable.

compress

set to True to compress the communications with the server

config_path

the path to an OpenSSH configuration file.

Additional keyword arguments will be passed to the underlying connection call, taking precedence over implicitly derived arguments. Once created, the SSHFS filesystem behaves like any other filesystem (see the Pyfilesystem2 documentation).

Files

SSHFS.openbin has the following extra options that can be passed as keyword arguments to control the file buffering:

prefetch

enabled by default, use a background thread to prefetch the content of a file opened in reading mode. Does nothing for files in writing mode.

pipelined

enable pipelined mode, avoid waiting for server answer between two uploaded chunks. Does nothing for files in reading mode.

Configuration

SSHFS are aware of SSH config files and as such, one of the hosts in the configuration file can be provided as the host argument for the filesystem to connect to the server with the proper configuration values.

Feedback

Found a bug ? Have an enhancement request ? Head over to the GitHub issue tracker of the project if you need to report or ask something. If you are filling in on a bug, please include as much information as you can about the issue, and try to recreate the same bug in a simple, easily reproductible situation.

See also

  • fs, the core pyfilesystem2 library

  • fs.archive, enhanced archive filesystems for pyfilesystem2

  • fs.smbfs, Pyfilesystem2 over SMB using pysmb

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.11.0.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

fs.sshfs-0.11.0-py2.py3-none-any.whl (21.3 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: fs.sshfs-0.11.0.tar.gz
  • Upload date:
  • Size: 23.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

File hashes

Hashes for fs.sshfs-0.11.0.tar.gz
Algorithm Hash digest
SHA256 6feae02e13806424a1772653973985495c093514d0ea5d0b3dd4ed1d3c86034b
MD5 beb9d8f9f4d95e958267898333738a33
BLAKE2b-256 d4aa96e1821e145d2001e2ded1381ac1dfb40ac5e918f361b617537eaf1c09b7

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: fs.sshfs-0.11.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.7

File hashes

Hashes for fs.sshfs-0.11.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 99e3347858bc26d70ef0d3eea3e032a6e76bdb382c28ada7f0579beba07cc823
MD5 1d73cc2d9f2a306ecb66cba038fd7eb1
BLAKE2b-256 ebd46119fb4f9351827a3e9f3d0be86fc11148c8c71b817394b390fd97afc587

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