Difference between revisions of "Ssh (OpenSSH client)"

From wikieduonline
Jump to navigation Jump to search
Line 10: Line 10:
  
 
Windows: Settings > Apps and click “Manage optional features” under Apps & features.
 
Windows: Settings > Apps and click “Manage optional features” under Apps & features.
 +
 +
== Configuration ==
 +
* Configuration file: <code>~/.ssh/[[config]]</code>
 +
  
 
== Usage ==
 
== Usage ==

Revision as of 13:13, 26 March 2020

ssh[1] is the OpenSSH ssh client for logging or executing commands into remote devices/machines

     ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
        [-E log_file] [-e escape_char] [-F configfile] [-I pkcs11] [-i identity_file] [-J destination] [-L address]
        [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port] [-Q query_option] [-R address] [-S ctl_path]
        [-W host:port] [-w local_tun[:remote_tun]] destination [command]
-X Enables X11 forwarding


Windows: Settings > Apps and click “Manage optional features” under Apps & features.

Configuration

  • Configuration file: ~/.ssh/config


Usage

  • ssh REMOTE_USERNAME@REMOTE_SERVER_NAME_OR_IP
  • ssh -vvv REMOTE_USERNAME@REMOTE_SERVER_NAME_OR_IP (-v increase verbosity, maximum 3)
    • ssh -vvv REMOTE_USERNAME@REMOTE_SERVER_NAME_OR_IP 2>&1 | grep "STRING_TO_SEARCH"

Execute a remote command:

  • ssh USERNAME@SERVER_NAME '/path/to/remote/scripts/backup.sh'

Multiplexing options

ssh -O check server.example.org or ssh -O check [email protected] 
Master running (pid=26289)
ssh -O check [email protected] 
Control socket connect(/path/): No such file or directory

To stop an specific multiplexed session:

ssh -O stop [email protected]

Avoid using Multiplexing for a connections:

ssh -o "ControlMaster=no" server.example.org

See also: Configure OpenSSH to reuse ssh connections

Activities

See also

  • http://man7.org/linux/man-pages/man1/ssh.1.html
  • Advertising: