Bagi saya, -o LogLevel=error
itu lebih baik daripada -q
, karena yang terakhir menekan informasi kesalahan penting (yang kemudian dapat Anda peroleh hanya melalui kode keluar).
Bandingkan ini (tanpa opsi):
[root@myserver804 myuser1]# ssh targetserver1; echo "exit code=$?"
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:hvtR8Dl09aUeCeG2cT5EA8b+nbCOoV6h1DUON2vE63w.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending RSA key in /root/.ssh/known_hosts:1735
RSA host key for targetserver1 has changed and you have requested strict checking.
Host key verification failed.
exit code=255
dengan ini (tenang)
[root@myserver804 myuser1]# ssh -q targetserver1; echo "exit code=$?"
exit code=255
dengan ini (hanya kesalahan log)
[root@myserver804 myuser1]# ssh -o LogLevel=error targetserver1; echo "exit code=$?"
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
SHA256:hvtR8Dl09aUeCeG2cT5EA8b+nbCOoV6h1DUON2vE63w.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending RSA key in /root/.ssh/known_hosts:1735
RSA host key for targetserver1 has changed and you have requested strict checking.
Host key verification failed.
exit code=255
Jadi kesimpulannya adalah - jika Anda masih tertarik pada kesalahan yang relevan, gunakan -o LogLevel=error
-q
atau-o LogLevel=error
bekerja dengan baik sekarang :-)