Updated documentation:

* remote shell usage for linux, cmd, and powershell
* help of wsproxy.
This commit is contained in:
Erik Brakkee 2024-08-01 20:53:52 +02:00
parent ff97c1ccd2
commit 0d60b70ada
3 changed files with 61 additions and 7 deletions

View File

@ -51,13 +51,14 @@ func printHelp(msg string) {
"\n" + "\n" +
" ssh -oServerAliveInterval=10 -oProxyCommand='wsproxy ws[s]://<host>[:port]/client/<ID>' abc@localhost\n" + " ssh -oServerAliveInterval=10 -oProxyCommand='wsproxy ws[s]://<host>[:port]/client/<ID>' abc@localhost\n" +
"\n" + "\n" +
"This latssh connect through wsproxy tocalhost\n" + "The above ssh commmand connects to the converge server listening on the websocket through \n" +
"wsproxy. \n" +
"\n" + "\n" +
"Options:\n" + "Options:\n" +
"\n" + "\n" +
"--insecure: Skip certificate validation when used over a secure connection.\n" + "--insecure: Skip certificate validation when used over a secure connection.\n" +
"--raw: Just use wsproxy as a raw stdio to websocket proxy, this disable messages\n" + "--raw: Just use wsproxy as a raw stdio to websocket proxy, this disables messages\n" +
" from the server.\n" " from the server so the user will not get clear error messages.\n"
fmt.Fprintln(os.Stderr, usage) fmt.Fprintln(os.Stderr, usage)
os.Exit(1) os.Exit(1)
} }

View File

@ -2,7 +2,10 @@
You can extend expiry of the session using You can extend expiry of the session using
{{ if eq .os "windows" -}} {{ if eq .os "windows" -}}
# cmd
echo > %agentdir%\.hold echo > %agentdir%\.hold
# powershell
$null > $env:agentdir\.hold
{{- else -}} {{- else -}}
touch $agentdir/.hold touch $agentdir/.hold
{{- end }} {{- end }}

View File

@ -48,7 +48,8 @@ templ Usage(secure string, host string, username string) {
</p> </p>
<p> <p>
The agent has more options, download the agent and run it without arguments to The agent has more command-line options than shown here.
Download the agent and run it without arguments to
see all options. see all options.
</p> </p>
@ -94,12 +95,61 @@ templ Usage(secure string, host string, username string) {
`}sftp -oServerAliveInterval=10 -oPort=10000 { username }{"@localhost"} {` `}sftp -oServerAliveInterval=10 -oPort=10000 { username }{"@localhost"} {`
`}</pre> `}</pre>
<h2>Remote shell usage</h2>
<p>
The agent supports a --shells command-line option by which a comma-separated
list of shells can be prepended to the default search path for shells, e.g.
<code>--shells zsh,csh,sh</code> (linux) or <code>cmd,powershell</code> for
windows.
</p>
<p>
The agent sets a <coder>agentdir</coder> environment variable that points to
the directory where the agent is running.
</p>
<h3>Linux</h3>
<pre>{`
# cd back to the agent directory
cd $agentdir
# extend session lifetime
touch $agentdir/.hold
`}</pre>
<pre>
</pre>
<h3>Windows Command Prompt</h3>
<pre>{`
# cd back to the agent directory
cd %agentdir%
# extend session lifetime
echo > %agentdir%\.hold
`}</pre>
<h3>Windows Powershell</h3>
<pre>{`
# cd back to the agent directory
cd $env:agentdir
# extend session lifetime
$null > $env:agentdir\.hold
`}</pre>
<h2>Authentication</h2> <h2>Authentication</h2>
<p> <p>
The <code>{ username }</code> user above the Converge server and The <code>{ username }</code> user above is configured in the
communicated to the agent when the agent is started. This is the Converge server and is communicated to the agent when the agent is
username that must be used when setting up an ssh connection. started as well as the password.
</p>
<p>
Another way to authenticate is through an .authorized_keys file in the Another way to authenticate is through an .authorized_keys file in the
same directory as where the agent is started. same directory as where the agent is started.