Difference between revisions of "Ssh (OpenSSH client)"

From wikieduonline
Jump to navigation Jump to search
Line 6: Line 6:
 
* <code>[[ssh]] -vvv REMOTE_USERNAME@REMOTE_SERVER_NAME_OR_IP</code> (<code>-v</code> increase verbosity, maximum 3)
 
* <code>[[ssh]] -vvv REMOTE_USERNAME@REMOTE_SERVER_NAME_OR_IP</code> (<code>-v</code> increase verbosity, maximum 3)
 
** <code>[[ssh]] -vvv REMOTE_USERNAME@REMOTE_SERVER_NAME_OR_IP 2>&1 | grep "STRING_TO_SEARCH" </code>  
 
** <code>[[ssh]] -vvv REMOTE_USERNAME@REMOTE_SERVER_NAME_OR_IP 2>&1 | grep "STRING_TO_SEARCH" </code>  
 +
Execute a remote command:
 +
* <code>ssh USERNAME@SERVER_NAME  '/path/to/remote/scripts/backup.[[sh]]'</code>
  
 
=== Multiplexing options ===
 
=== Multiplexing options ===

Revision as of 16:51, 3 January 2020

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


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: