Skip to content

Commit

Permalink
Improved commands in README
Browse files Browse the repository at this point in the history
  • Loading branch information
dmotte committed Apr 18, 2024
1 parent 740aafc commit bd788ad
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,16 @@ When you have everything ready, you can start the server with:

```bash
docker run -it --rm \
-v $PWD/hostkeys:/ssh-host-keys \
-v $PWD/myclientkey.pub:/ssh-client-keys/myuser/myclientkey.pub:ro \
-p 80:8080 \
-p 2222:22 \
dmotte/portmap-server \
myuser:8080
-v "$PWD/hostkeys:/ssh-host-keys" \
-v "$PWD/myclientkey.pub:/ssh-client-keys/myuser/myclientkey.pub:ro" \
-p80:8080 -p2222:22 \
dmotte/portmap-server myuser:8080
```

To test the server on-the-fly, you can connect to it and setup a remote port forwarding tunnel, by running the following OpenSSH command in another shell:

```bash
ssh \
-i myclientkey \
myuser@localhost \
-p 2222 \
-Nv \
-R 8080:google.it:80
ssh -i myclientkey myuser@localhost -p2222 -NvR8080:google.it:80
```

This will serve `http://google.it/` on port `8080` of the server container, which is exposed to port `80` of your host machine due to the `-p 80:8080` docker run flag specified before. Note that, for this to work, the `myclientkey` must have **`600` permissions**. If this isn't the case, you can achieve it with:
Expand Down

0 comments on commit bd788ad

Please sign in to comment.