Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Turn SSH into a thin client specifically for your app

License

NotificationsYou must be signed in to change notification settings

dokku/sshcommand

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Simplifies running a single command over SSH, and manages authorized keys (ACL) and users in order to do so.

It basically simplifies running:

ssh user@server'ls -l <your-args>'

into:

ssh ls@server<your-args>

Commands

sshcommand create<USER><COMMAND># Creates a local system user and installs sshcommand skeletonsshcommand acl-add<USER><NAME><KEY_FILE># Adds named SSH key to user from STDIN or argumentsshcommand acl-remove<USER><NAME># Removes SSH key by namesshcommand acl-remove-by-fingerprint<USER><FINGERPRINT># Removes SSH key by fingerprintsshcommand list<USER> [<NAME>] [<OUTPUT_TYPE>]# Lists SSH keys by user, an optional name and a optional output format (JSON)sshcommandhelp<COMMAND># Shows help informationsshcommand version# Shows version

Example

On a server, create a new command user:

sshcommand create cmd /path/to/command

On your computer, add authorized keys with your key:

cat~/.ssh/id_rsa.pub| ssh root@server sshcommand acl-add cmd progrium

If the public key is already on the server, you may also specify it as an argument:

ssh root@server sshcommand acl-add cmd progrium~/.ssh/id_rsa.pub

By default, key names and fingerprints must be unique. Both of these checks can be disabled by setting the following environment variables tofalse:

export SSHCOMMAND_CHECK_DUPLICATE_FINGERPRINT="false"export SSHCOMMAND_CHECK_DUPLICATE_NAME="false"

Now anywhere with the private key you can easily run:

ssh cmd@server

Anything you pass as the command string will be appended to the command. You can use thisto pass arguments or if your command takes subcommands, expose those subcommands easily.

/path/to/command subcommand

Can be run remotely with:

ssh cmd@server subcommand

When adding an authorized key, you can also specify custom options forAUTHORIZED_KEYSby specifying theSSHCOMMAND_ALLOWED_KEYS environment variable. This should be a listof comma-separated options. The default keys are as follows:

no-agent-forwarding,no-user-rc,no-X11-forwarding,no-port-forwarding

This can be useful for cases where the ssh server does not allow certain options or youwish to further constrain a user's environment. Please seeman sshd for more information.

Existing keys can be listed via thelist subcommand:

# in text formatsshcommand list cmd# filter by a particular namesshcommand list cmd progrium# in json formatsshcommand list cmd"" json# with name filteringsshcommand list cmd progrium json# ignore validation errors (though they will be printed to stderr)export SSHCOMMAND_IGNORE_LIST_WARNINGS=truesshcommand list cmd

About

Turn SSH into a thin client specifically for your app

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors20


[8]ページ先頭

©2009-2025 Movatter.jp