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-07-17 06:35:16
最后一次提交
發布數23
最新版本名稱v0.20.0 (發布於 )
第一版名稱v0.1.0 (發布於 2016-04-02 21:55:53)
用户参与
星數381
關注者數10
派生數50
提交數353
已啟用問題?
問題數11
打開的問題數0
拉請求數128
打開的拉請求數2
關閉的拉請求數68
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?