File: README.md

package info (click to toggle)
sshcommand 0~20160110.1~2795f65-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid, stretch
  • size: 100 kB
  • ctags: 17
  • sloc: sh: 188; makefile: 53
file content (46 lines) | stat: -rw-r--r-- 1,390 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# sshcommand [![Build Status](https://img.shields.io/circleci/project/dokku/sshcommand/master.svg?style=flat-square "Build Status")](https://circleci.com/gh/dokku/sshcommand/tree/master)

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> <ssh-key-name>        # adds named SSH key to user from STDIN
    $ sshcommand acl-remove <user> <ssh-key-name>     # removes SSH key by name
    $ sshcommand help                                 # displays the usage help message


## 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

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