Editing Ssh (OpenSSH client)

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{lowercase}}
 
 
<code>ssh</code><ref>http://man7.org/linux/man-pages/man1/ssh.1.html</ref> is the [[OpenSSH]] [[ssh clients|ssh client]] for logging or executing commands into remote devices/machines
 
<code>ssh</code><ref>http://man7.org/linux/man-pages/man1/ssh.1.html</ref> is the [[OpenSSH]] [[ssh clients|ssh client]] for logging or executing commands into remote devices/machines
* Man page: https://linux.die.net/man/1/ssh
 
* <code>[[ssh --help]]</code>
 
  
 
       ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
 
       ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface] [-b bind_address] [-c cipher_spec] [-D [bind_address:]port]
Line 9: Line 6:
 
         [-W host:port] [-w local_tun[:remote_tun]] destination [command]
 
         [-W host:port] [-w local_tun[:remote_tun]] destination [command]
  
* <code>-X Enables X11 [[forwarding]]</code>
+
-X Enables X11 forwarding
* <code>-N Do not execute a [[remote command]]. This is usefull for just [[forwarding]] ports</code>
+
 
* <code>[[ssh -vvv]]</code>
+
[[OpenSSH changelog|ssh -V]]
* <code>[[ssh -V]]</code>
+
 
* <code>[[ssh -t]]</code>
 
* <code>[[ssh -O]]</code>
 
* <code>ssh -o ConnectTimeout=100</code>
 
* <code>[[ssh -i]]</code>
 
* <code>[[ssh -L]]</code>
 
* <code>[[ssh -R]]</code>
 
  
 
Windows: Settings > Apps and click “Manage optional features” under Apps & features.
 
Windows: Settings > Apps and click “Manage optional features” under Apps & features.
  
 
== Configuration ==
 
== Configuration ==
* Configuration file: <code>[[~/.ssh/config]]</code>
+
* Configuration file: <code>~/.ssh/[[config]]</code>
* <code>[[~/.ssh/environment]]</code>
+
 
  
 
== Usage ==
 
== Usage ==
* <code>[[ssh]] remote_User@server_Name_Or_IP</code>
+
* <code>[[ssh]] REMOTE_USERNAME@REMOTE_SERVER_NAME_OR_IP</code>
* <code>ssh  [email protected] -p 1111 [[-i]] ./yourprivkey</code>
+
* <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:
 
Execute a remote command:
 
* <code>ssh USERNAME@SERVER_NAME  '/path/to/remote/scripts/backup.[[sh]]'</code>
 
* <code>ssh USERNAME@SERVER_NAME  '/path/to/remote/scripts/backup.[[sh]]'</code>
  
* <code>[[ssh -Q]] kex SERVER</code>
+
* <code>ssh -Q kex SERVER</code>
 
 
== Example commands ==
 
* <code>ssh -o [[StrictHostKeyChecking]]=accept-new [email protected]</code> (since [[OpenSSH 7.5]], March 2017)
 
* <code>ssh -o StrictHostKeyChecking=no [email protected]</code><ref>https://serverfault.com/a/132973</ref>
 
* <code>ssh -Q [[kex]] SERVER</code>
 
* <code>ssh -o [[MACs]]=[[hmac-sha2-256]] HOSTNAME</code>
 
  
 
== [[Multiplexing]] options ==
 
== [[Multiplexing]] options ==
[[ssh -O]] check server.example.org or ssh -O check [email protected]  
+
<pre>ssh -O check server.example.org or ssh -O check [email protected]  
Master running (pid=26289)
+
Master running (pid=26289)
 +
</pre>
  
ssh -O check [email protected]  
+
<pre>
Control socket connect(/path/): No such file or directory
+
ssh -O check [email protected]  
 +
Control socket connect(/path/): No such file or directory
 +
</pre>
  
 
To stop an specific multiplexed session:
 
To stop an specific multiplexed session:
Line 59: Line 46:
  
 
== Logs ==
 
== Logs ==
  [[ssh -i]] id_ed25519_xxxxx.pub SERVER_NAME
+
  ssh -i id_ed25519_xxxxx.pub SERVER_NAME
 
  Load key "id_ed25519_xxxxx.pub": invalid format
 
  Load key "id_ed25519_xxxxx.pub": invalid format
 
  Solution:
 
  Solution:
Line 65: Line 52:
 
  ssh -i id_ed25519_xxxxx SERVER_NAME
 
  ssh -i id_ed25519_xxxxx SERVER_NAME
  
* <code>[[Unable to negotiate with]] ([[KexAlgorithms]])</code>
+
* [[Unable to negotiate with]] ([[KexAlgorithms]])
  
 
== Activities ==
 
== Activities ==
Line 71: Line 58:
 
* [[Configure OpenSSH to reuse ssh connections]]
 
* [[Configure OpenSSH to reuse ssh connections]]
 
* [[Execute a command in parallel by ssh]]
 
* [[Execute a command in parallel by ssh]]
* <code>[[ssh]] -o [[PreferredAuthentications]]=keyboard-interactive -o [[PubkeyAuthentication]]=no host1.example.org</code>
 
* [[Reverse SSH tunneling]]
 
 
== Configuration ==
 
* <code>[[CheckHostIP]]</code>
 
 
== Related ==
 
* <code>[[gcloud compute ssh]]</code>
 
* [[Load key ... invalid format]]
 
  
 
== See also ==
 
== See also ==
* {{ssh (openSSH)}}
+
* {{OpenSSH}}
 +
* {{ncat}}
 +
* {{tmux}}
 
* {{ssh clients}}
 
* {{ssh clients}}
  
 
[[Category:Networking]]
 
[[Category:Networking]]
 
[[Category:Linux]]
 
[[Category:Linux]]

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: