Giter Club home page Giter Club logo

fs.sshfs's Introduction

fs.sshfs

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
property-cached PyPI property Source property License property

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

fs.sshfs's People

Contributors

althonos avatar djsutherland avatar paulgessinger avatar reimarbauer avatar willmcgugan avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.