Giter VIP home page Giter VIP logo

sftpman's Introduction

SftpMan with the GTK frontend

https://github.com/spantaleev/sftpman-gtk/raw/master/sftpman-gui.png


SftpMan consists of a Command Line and a GTK application (packaged separately) that make it simpler to setup and mount SSHFS/SFTP file systems.

The idea was to develop a simple CLI/GUI application for Linux that can be used to manage SFTP systems.

It relies on sshfs to do all the mounting work. SftpMan allows you to setup many remote filesystems and helps you easily mount/unmount them.

Every system managed by SftpMan is identified by an id such as my-machine, which is used in file paths and when managing the system.

Configuration data is stored in ~/.config/sftpman/ as JSON files.

All systems are mounted under /mnt/sshfs/. For the my-machine machine, that would be /mnt/sshfs/my-machine.


Installing on ArchLinux

On ArchLinux, there's an official sftpman AUR package. To install using yaourt:

yaourt -S sftpman

The package takes care of all dependencies and SftpMan should be able to start.

Optional dependencies will be suggested to you upon install.

Installing on other distributions

For other distributions you can install using pip:

pip install sftpman

You also need to install sshfs yourself.

CLI Application

The CLI application (sftpman executable) supports the following commands:

help:
 - Displays this help menu.

ls:
 - Lists the available/mounted/unmounted sftp systems.
        Usage: sftpman ls {what}
        Where {what} is one of: available, mounted, unmounted

mount:
 - Mounts the specified sftp system, unless it's already mounted.
        Usage: sftpman mount {id}..

mount_all:
 - Mounts all sftp file systems known to sftpman.
        Usage: sftpman mount_all

preflight_check:
 - Detects whether we have everything needed to mount sshfs filesystems.

rm:
 - Removes a system by id.
        Usage: sftpman rm {system_id}..
        For a list of system ids, see `sftpman ls available`.

setup:
 - Defines a new sftp file system configuration or edits an old one with the same id.
        Usage: sftpman setup {options}
        Available {options}:
            --id={unique system identifier}
                You use this to recognize and manage this sftp system.
                It determines what the local mount point is.
                If `--id=example`, the filesystem will be mounted to: `/mnt/sshfs/example`
            --host={host to connect to}
            --port={port to connect to} [default: 22]
            --user={username to authenticate with} [default: current user]
            --mount_opt={option to pass to sshfs} [optional] [can be passed more than once]
                Example: --mount_opt="follow_symlinks" --mount_opt="workaround=rename"
                `sshfs --help` tells you what sshfs options are available
            --mount_point={remote path to mount}
            --auth_method={method}
                Specifies the authentication method.
                Can be `password` or `publickey`. [default: publickey]
            --ssh_key={path to the ssh key to use for authentication}
                Only applies if auth_method is `publickey`.
            --cmd_before_mount={command to run before mounting} [default: /bin/true]
                Allows you to run a custom command every time this system is mounted.

umount:
 - Unmounts the specified sftp system.
        Usage: sftpman umount {id}..

umount_all:
 - Unmounts all sftp file systems known to sftpman.
        Usage: sftpman umount_all

GUI Application

sftpman-gtk is a GTK frontend for sftpman, which is packaged separately. Installing the frontend automatically installs the CLI application as a dependency.

Dependencies

Known limitations

  • Doesn't support mounting in a location different than /mnt/sshfs/

sftpman's People

Contributors

d-vaillant avatar semyon-san avatar spantaleev avatar thomastoye avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

sftpman's Issues

Usernames cannot contain "@"

My school gives us the ability to access a personal home folder over ssh. Our username is the same for every school service, and looks like "[email protected]".

Both sftpman and sftpman-gtk will refuse this string because it contains an "@":
- user / Usernames can only contain letters and digits.

Usernames with underscore are not allowed

It's not uncommon for usernames to contain an underscore character, but sftpman refuses them and throws the error : « Usernames can only contain letters, at signs and digits. »

Edit : I user sftpman-gtk, so I'm not sure if this applies to gtk only.

--mount_opt not working

Values provided via --mount_opt are not present in the resulting json config file.

Arch linux

ssh-agent authentication not supported

If auth_method is set to publickey sftpman forces the user to specify a path to any ssh_key.
As ssh-agent is used it's not possible to tell this path.
sshfs/ssh are working out of the box with ssh-agent if no "-i identity_file" is given.

Ability to change mount_path_base by configuration

It would be great if the mount path (currently fixed /mnt/sshfs) were configurable by the user.

Edit: Ah, just noticed it's under Known limitations. Well, let's keep this issue for better reference and discussion then.

FTP support

What do you think of adding FTP support using curlftpfs? One could create a copy of sftpman (name it ftpman) and just substitute sshfs commands with curlftpfs but that's just silly.

One can solve it it two ways:

  1. Add protocol option to config file of sftpman to specify if you want to mount using ftp or sftp (easier way)
  2. Extract code base from sftpman that manages the mounted servers and name it "mounting engine". Then different implementations for different protocols (sftpman, ftpman) use the mounting engine but specifiy their unique commands to mount/unmount and parsing of their config files. (harder but better)

Use configured sshconf host

If I have my host and ssh options already defined in sshconf, I should be able to just use that config and not have to redefine everything.

allow more characters in machine ids

Hi,
Any reason why machine ids need to be alphanumeric? For example, it seems reasonable to have ids name "user@remote" (in case of multiple users on a system).
The only restriction that seems necessary is no-slash and no null-byte (so that /mnt/sshfs/$machine-id stays a valid path (and even then I guess the slash could be allowed, it's just whether you want to bother supporting it...)).
Thanks.

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.