Table of Contents
SSH - Quiet Mode
Preface
In past days, one of my colleague has told me that he was missing one feature of SSH on this website. This feature is really handy for peoples using SSH as communication protocol in theyr scripts.
According to this I’d like to share this as well on this website.
Thanks Laco.
Overhead – to filer
When using SSH as communication protocol in your script, it’s important to reduce useless information that SSH provide during establishing connection.
Example:
[root@SSH_Client ~]# ssh root@SSH_Server "uptime ; uname -a" # Execute command on SSH Server ------------------------------------ # Information that we’ll filter | This is test SSH server used for | # Information that we’ll filter | | # Information that we’ll filter | http://www.IggyT.org | # Information that we’ll filter | | # Information that we’ll filter | Explanation and Documentation | # Information that we’ll filter | Purposes | # Information that we’ll filter ------------------------------------ # Information that we’ll filter 22:30:20 up 27 min, 1 user, load average: 0.00, 0.00, 0.00 Linux SSH_Server 2.6.32-431.20.3.el6.x86_64 #1 SMP Thu Jun 19 21:14:45 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
How to filler it (ssh -q ...)
Use parameter “-q”, to filter out useless information that we don’t need (especially when writing scripts).
Example:
[root@SSH_Client ~]# ssh -q root@SSH_Server "uptime ; uname -a" # Execute command on SSH Server 22:30:32 up 27 min, 1 user, load average: 0.00, 0.00, 0.00 Linux SSH_Server 2.6.32-431.20.3.el6.x86_64 #1 SMP Thu Jun 19 21:14:45 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
-q Quiet mode. Causes most warning and diagnostic messages to be suppressed.