sshcommand

Turn SSH into a thin client specifically for your app

  • 所有者: dokku/sshcommand
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

sshcommand Build Status

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 user forced to run command when SSH connects
sshcommand acl-add    <USER> <NAME> <KEY_FILE>  # Adds named SSH key to user from STDIN or argument
sshcommand acl-remove <USER> <NAME>             # Removes SSH key by name
sshcommand list       <USER> [<NAME>]           # Lists SSH keys by user and an optional name
sshcommand help       <COMMAND>                 # Shows help information
sshcommand 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

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 this
to 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 for AUTHORIZED_KEYS
by specifying the SSHCOMMAND_ALLOWED_KEYS environment variable. This should be a list
of 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 you
wish to further constrain a user's environment. Please see man sshd for more information.

主要指标

概览
名称与所有者dokku/sshcommand
主编程语言Shell
编程语言Shell (语言数: 3)
平台
许可证MIT License
所有者活动
创建于2013-06-12 00:31:01
推送于2025-06-12 06:09:22
最后一次提交
发布数23
最新版本名称v0.20.0 (发布于 )
第一版名称v0.1.0 (发布于 2016-04-02 21:55:53)
用户参与
星数381
关注者数10
派生数50
提交数353
已启用问题?
问题数11
打开的问题数0
拉请求数128
打开的拉请求数2
关闭的拉请求数65
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?