Skip to main content

Pyfilesystem2 over SSH 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

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]")

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.

Once created, the SSHFS filesystem behaves like any other filesystem (see the Pyfilesystem2 documentation).

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.proxy, miscellaneous proxy 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.5.2.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

fs.sshfs-0.5.2-py2.py3-none-any.whl (13.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for fs.sshfs-0.5.2.tar.gz
Algorithm Hash digest
SHA256 9aa026da31761e9fb2660e73078622b085fc2d0ba87dad18fdeef0b7d43dc36e
MD5 7ad24ea2a1e0937c848722cd5568e1bb
BLAKE2b-256 b61b8e0c93910df9f4df98700015bbd71b1c455afd89d867b1f7b23bb3dedd70

See more details on using hashes here.

Provenance

File details

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

File metadata

File hashes

Hashes for fs.sshfs-0.5.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b5963c1a96af46e64d7c14d099b4880b61c6953ede07179dd21fc402df88ef37
MD5 36c09d0f9602da2df6a263a7ed1bceb6
BLAKE2b-256 dfab55a584a65a061ace39551591e32af0fcb9466db8b8c4feefdfdfd9854e23

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