aboutsummaryrefslogtreecommitdiffstats
path: root/sshcd.1
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--sshcd.1361
1 files changed, 361 insertions, 0 deletions
diff --git a/sshcd.1 b/sshcd.1
new file mode 100644
index 0000000..d2a0265
--- /dev/null
+++ b/sshcd.1
@@ -0,0 +1,361 @@
+.TH SSHCD 1 sshexec
+
+.SH NAME
+sshcd - open ssh(1) with a specific remote working directory
+
+.SH SYNOPSIS
+.B sshcd
+.RB [ {
+.RI [\fBssh=\fP ssh-command ]
+.RB [ cd= ( strict | lax )]
+.BR } ]
+.RI [ ssh-option ]\ ...\,
+.I destination
+
+.SH DESCRIPTION
+The
+.B sshcd
+utility is a wrapper for SSH that makes it lets the user
+specify the directory remote working directory.
+.PP
+.B sshcd
+passes any argument after
+.B }
+to
+.I ssh-command
+.RB ( ssh
+if not specified), except it may rewrite
+.I destination
+to remove information that's not supported by
+.BR ssh (1).
+
+.SH OPTIONS
+.B sshcd
+options may be placed at the very beginning enclosed with
+the arguments
+.B {
+and
+.BR } .
+.B sshcd
+options, if any, shall be placed in the same
+.B {
+.BR } -group.
+Any other option will be passed as is to the
+.BR ssh (1)
+utility or
+.IR ssh-command .
+The
+.B sshcd
+utility has a build it list of options recognised by the
+.BR ssh (1)
+utility and will not allow anything matching this list.
+The
+.B sshcd
+utility does not allow mixing options and operands: no
+option may be placed after
+.IR destination .
+.PP
+The following
+.B sshcd
+options are supported:
+.TP
+.BI ssh= ssh-command
+Instead of looking for
+.B ssh
+in
+.IR PATH ,
+the
+.B sshcd
+utility shall use
+.IR ssh-command ,
+which it will look for in
+.I PATH
+if it is only a file name (does not contain a slash
+.RB ( / )).
+.TP
+.B cd=strict
+Fail without executing the
+.I command
+if it's not possible to set
+.I directory
+as the remote working directory.
+.TP
+.B cd=lax
+Continue (but warn) executing the
+.I command
+even if it's not possible to set
+.I directory
+as the remote working directory.
+
+.SH OPERANDS
+The following operands are supported:
+.TP
+.I destination
+The destination to connect and log into. It shall be either in
+the form
+.RI [ user\fP\fB@ ] hostname [\fB:\fP directory ]
+or in the form
+.BR ssh [ cd ] :// [\fIuser @ ]\fIhostname\fP[ : \fIport\fP][ / \fIdirectory\fP].
+
+.I user
+shall be the name of the remote user. If not specified,
+the name of the local user running the utility will be used.
+
+.I hostname
+shall be the address to the remote machine.
+
+.I port
+shall be the port or service name for the port to
+connect to on the remote machine.
+
+.I directory
+shall be directory to change the remote working directory.
+
+.SH STDIN
+The
+.B sshcd
+utility itself does not use the standard input.
+
+.SH INPUT FILES
+None.
+
+.SH ENVIRONMENT VARIABLES
+The following environment variables affects the execution of
+.BR sshcd :
+.TP
+.I PATH
+Default. See to the Base Definitions volume of POSIX.1-2017, Section 8.3, Other Environment Variables.
+This environment variable affects where the
+.B sshcd
+utility can find the
+.BR ssh (1)
+utility or
+.IR ssh-command .
+.TP
+.I SSHCD_PTY_ALLOC_FLAG
+Specifies the option to pass to
+.BR ssh (1)
+to tell SSH to allocate a pseudo terminal. If unset
+.B -t
+will be used. If set but empty, no flag will be passed to
+.BR ssh (1).
+.TP
+.I SSHEXEC_SSH
+If set and non-empty, it overrides the default value of
+.I ssh-command
+from
+.B ssh
+to the value of the variable.
+.TP
+.I SSHEXEC_OPTS_NO_ARG
+List of options that
+.B sshexec
+shall interpret as
+.BR ssh (1)
+options that do not have any argument.
+(Default is
+.BR 46AaCfGgKkMNnqsTtVvXxYy ,
+meaning the options
+.BR -4 ,
+.BR -6 ,
+.BR -A ,
+.BR -a ,
+.BR -C ,
+.BR -f ,
+.BR -G ,
+.BR -g ,
+.BR -K ,
+.BR -k ,
+.BR -M ,
+.BR -N ,
+.BR -n ,
+.BR -q ,
+.BR -s ,
+.BR -T ,
+.BR -t ,
+.BR -V ,
+.BR -v ,
+.BR -X ,
+.BR -x ,
+.BR -Y ,
+and
+.BR -y .)
+.TP
+.I SSHEXEC_OPTS_ARG
+List of options that
+.B sshexec
+shall interpret as
+.BR ssh (1)
+options that have an argument.
+(Default is
+.BR BbcDEeFIiJLlmOoPpQRSWw ,
+meaning the options
+.BR -B ,
+.BR -b ,
+.BR -c ,
+.BR -D ,
+.BR -E ,
+.BR -e ,
+.BR -F ,
+.BR -I ,
+.BR -i ,
+.BR -J ,
+.BR -L ,
+.BR -l ,
+.BR -m ,
+.BR -O ,
+.BR -o ,
+.BR -P ,
+.BR -p ,
+.BR -Q ,
+.BR -R ,
+.BR -S ,
+.BR -W ,
+and
+.BR -w .)
+.TP
+.I SSHEXEC_OPTS_OPT_ATTACHED_ARG
+List of options that
+.B sshexec
+shall interpret as
+.BR ssh (1)
+options that have an argument only if
+there are additional characters after
+the option character in the same
+command line argument. (Default is
+the empty string, meaning no options.)
+.TP
+.I SSHEXEC_OPTS_OPT_ARG
+List of options that
+.B sshexec
+shall interpret as
+.BR ssh (1)
+options that have an argument if there
+are additional characters after
+the option character in the same
+command line argument or if argument is
+followed directly by another argument
+which does not start with a dash
+.RB ( - ).
+(Default is
+the empty string, meaning no options.)
+.TP
+.I SSHEXEC_LONG_OPTS_NO_ARG
+Space-separated list of long options that
+.B sshexec
+shall interpret as
+.BR ssh (1)
+options that do not have any argument
+unless it is followed directly by an
+equals sign
+.RB ( = )
+in the same command line argument.
+Options that do not start with two dashes
+.RB ( -- )
+are silently ignored. (Default is the
+empty string, meaning no options.)
+.TP
+.I SSHEXEC_LONG_OPTS_ARG
+Space-separated list of long options that
+.B sshexec
+shall interpret as
+.BR ssh (1)
+options that have an argument that must
+either be specified in the next command
+line argument or after an
+equals sign
+.RB ( = )
+the shall directly follow the option
+string in the same command line argument.
+Options that do not start with two dashes
+.RB ( -- )
+are silently ignored. (Default is the
+empty string, meaning no options.)
+.TP
+.I SSHEXEC_LONG_OPTS_OPT_ARG
+Space-separated list of long options that
+.B sshexec
+shall interpret as
+.BR ssh (1)
+options that have an argument if it is
+the option string is is directly followed
+by equals sign
+.RB ( = )
+in the same command line argument or if
+argument is followed directly by another
+argument which does not start with a dash
+.RB ( - ).
+Options that do not start with two dashes
+.RB ( -- )
+are silently ignored. (Default is the
+empty string, meaning no options.)
+.PP
+Other environment variables may affect the execution of the
+.BR ssh (1)
+utility.
+
+.SH ASYNCHRONOUS EVENTS
+Default.
+
+.SH STDOUT
+The
+.B sshcd
+utility itself does not use the standard output.
+
+.SH STDERR
+The standard error is used for diagnostic messages in the
+.B sshcd
+utility itself.
+
+.SH OUTPUT FILES
+None.
+
+.SH EXTENDED DESCRIPTION
+None.
+
+.SH EXIT STATUS
+The
+.B sshcd
+utility exits with the exit status of the
+.BR ssh (1)
+utility or with 255 if an error occurred.
+
+.SH CONSEQUENCES OF ERRORS
+Default.
+
+.SH APPLICATION USAGE
+None.
+
+.SH EXAMPLES
+None.
+
+.SH RATIONALE
+For historical reasons, the
+.B sshcd
+utility does not let the user add a command to run
+inside the directory. This also avoids problems; if the
+user want to run a command in a specific directory,
+.BR sshexec (1)
+lets the user do so in an intuitive manner; for other
+traditional syntax,
+.BR ssh (1)
+can still be used — specifying a
+.BR cd (1)
+command at the beginning shouldn't be a problem.
+
+.SH NOTES
+None.
+
+.SH BUGS
+None.
+
+.SH FUTURE DIRECTIONS
+None.
+
+.SH SEE ALSO
+.BR ssh (1),
+.BR sshexec (1)
+
+.SH AUTHORS
+Mattias Andrée
+.RI < m@maandree.se >