Documentation
¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Command ¶
type Command struct { Host string User string Port int SSHOptions []string Gateway *Command Command []string Debug bool NoEscapeCommand bool SkipHostKeyChecking bool Quiet bool AllocateTTY bool // contains filtered or unexported fields }
Command contains settings to build a ssh command
Example ¶
Output:
Example (Complex) ¶
Output:
Example (Gateway) ¶
Output:
Example (Options) ¶
Output:
func (*Command) Slice ¶
Slice returns an execve compatible slice of arguments
Example ¶
Output: [ssh 1.2.3.4 -p 22]
Example (Complex) ¶
Output: ["ssh" "-q" "-o" "UserKnownHostsFile=/dev/null" "-o" "StrictHostKeyChecking=no" "-o" "ProxyCommand=ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -W %h:%p -l toor 5.6.7.8 -t -t -p 22" "1.2.3.4" "-t" "-t" "-p" "22" "--" "/bin/sh" "-e" "-c" "\"echo hello world\""]
Example (Gateway) ¶
Output: ["ssh" "-o" "ProxyCommand=ssh -W %h:%p 5.6.7.8 -p 22" "1.2.3.4" "-p" "22"]
Example (Options) ¶
Output: ["ssh" "-q" "-o" "UserKnownHostsFile=/dev/null" "-o" "StrictHostKeyChecking=no" "-l" "root" "1.2.3.4" "-t" "-t" "-p" "22" "--" "/bin/sh" "-e" "-x" "-c" "\"\\\"echo\\\" \\\"hello world\\\"\""]
Example (User) ¶
Output: [ssh -l root 1.2.3.4 -p 22]
func (*Command) String ¶
String returns a copy-pasteable command, useful for debugging
Example ¶
Output: ssh 1.2.3.4 -p 22
Example (Complex) ¶
Output: ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o "ProxyCommand=ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -W %h:%p -l toor 5.6.7.8 -t -t -p 22" 1.2.3.4 -t -t -p 22 -- /bin/sh -e -c "\"\\\"echo\\\" \\\"hello world\\\"\""
Example (Options) ¶
Output: ssh -q -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no 1.2.3.4 -t -t -p 22 -- /bin/sh -e -x -c "\"\\\"echo\\\" \\\"hello world\\\"\""
Click to show internal directories.
Click to hide internal directories.