Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>There is no clean solution for the problem you noted as far as I am aware.<br> The previously suggested /dev/null redirection will still display the warning, it just disables the security feature of storing the remote keys by redirecting the output into /dev/null.<br> So ssh would still think it writes something which is actually discarded. </p> <p>As I know the only option is to catch the message and remove it from stdout. </p> <pre><code>ssh/scp..... 2&gt;&amp;1 | grep -v "^Warning: Permanently added" </code></pre> <p>Here is a complete example that you can use as wrapper to hide such warnings: </p> <pre><code>#!/bin/bash remove="^Warning: Permanently added" # message to remove from output cmd=${0##*/} case $cmd in ssh) binary=/usr/bin/ssh ;; *) echo "unsupported binary ($0)" exit ;; esac $binary "$@" 2&gt;&amp;1 | grep -v "$remove" </code></pre> <p>To install it all you need to do is add/modify the "case" statement for the actual command you wish to modify. (ssh, scp, git etc).<br> the "ssh)" means the script has to be named "ssh" (or a link to the script is named ssh). The binary=/full/path is the path to the binary the script should wrap.<br> Then put the script with a name of your choice into /bin or somewhere else. </p> <p>The script also the place where you can use a <em>-o "UserKnownHostsFile=/dev/null"</em> to the $binary variable, that's a lot better than putting such a security risk into the global ssh configuration which will affect all your ssh sessions and not just those you want to supress the message. </p> <p>Disadvantages:<br> It's a bit overhead, not a perfectly clean solution and moves stderr into stdout which might not be good in all cases.<br> But it will get rid of any sort of warning messages you don't wish to see and you can use a single script to wrap all binaries you want (by using filesystem links to it)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload