Skip to main content

fs.sshfs star me

Source PyPI Conda Actions Codecov Codacy License Versions Format GitHub issues Downloads Changelog

Requirements

PyFilesystem2 PyPI fs Source fs License fs
six PyPI six Source six License six
paramiko PyPI paramiko Source paramiko License paramiko
property-cached PyPI property Source property License property

fs.sshfs supports all Python versions supported by PyFilesystem2: Python 2.7, and Python 3.5 onwards. Code should still be compatible with Python 3.4, but not tested anymore.

Installation

Install directly from PyPI, using pip:

$ pip install fs.sshfs

There is also a conda-forge package available:

$ conda install -c conda-forge 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]")

The sftp scheme can be used as an alias for the ssh scheme in the FS URL. Additional argument can be passed to the SSHFS constructor as percent-encoded URL parameters (excepted policy). See section below for a list of all supported arguments.

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, passwd=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.
  • exec_timeout: the timeout, in seconds, for arbitrary SSH commands on the server.
  • policy: a paramiko.MissingHostKeyPolicy instance, or None to use paramiko.AutoAddPolicy.

Additional keyword arguments will be passed to the underlying paramiko.SSHClient.connect 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.

Credits

fs.sshfs is developed and maintained by:

The following people contributed to fs.sshfs:

This project obviously owes a lot to the PyFilesystem2 project and all its contributors.

See also

  • fs, the core PyFilesystem2 library
  • fs.archive, enhanced archive filesystems for PyFilesystem2
  • fs.smbfs, PyFilesystem2 over SMB using pysmb

Release files for fs.sshfs 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fs.sshfs 1.0.2
File Size Uploaded
fs.sshfs-1.0.2.tar.gz 32.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fs.sshfs 1.0.2
File Interpreter ABI Platform
fs.sshfs-1.0.2-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 56.2 kB

Release files / fs.sshfs-1.0.2.tar.gz

Download URL fs.sshfs-1.0.2.tar.gz
Size 32.2 kB
Tags Source
SHA-256 checksum
How to use checksums
9a6a8567abf8925cd41d06a13c4af6097b48d0d0776fc7785a482a0428b0fc19
BLAKE2b-256 checksum
How to use checksums
de8d2bb9ccdbc781eefaac8791fec792caa6616c237efbd8df524fc9f51f77d9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release files / fs.sshfs-1.0.2-py2.py3-none-any.whl

Download URL fs.sshfs-1.0.2-py2.py3-none-any.whl
Size 24.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ff7d7aeef546017f5c430e33c7deea50a1728ebeea738d5c5754bd56f8601109
BLAKE2b-256 checksum
How to use checksums
85cd22021dd08d80297ffb144f740e93763416ea5bed91cea0cbfe656360d1b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.9.17

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.13.1

2 release files

0.12.3

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.1

2 release files

0.11.0

2 release files

0.10.2

2 release files

0.10.1

2 release files

0.9.0

2 release files

0.8.0

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.7.0

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page