小编con*_*are的帖子

SSH 进入一个经常更改 IP 的盒子

我有一些经常更改 IP 的云盒。

我使用主机名 ssh,但由于此错误消息,每次服务器启动时都必须编辑 known_hosts 文件:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is…
Run Code Online (Sandbox Code Playgroud)

除了任何安全风险以及与我想做的事情相关的风险之外,有没有办法忽略此错误或自动覆盖 known_hosts 文件,以便我不必总是自己编辑它?

ssh bash known-hosts fingerprint

31
推荐指数
3
解决办法
2万
查看次数

阻止 Apache 将重复的日志条目写入 access_log

我有以下几行与登录我的 Apache vhost 文件有关

SetEnvIf Request_URI "^/server-status$" dontlog
SetEnvIf Request_URI "^/haproxy-status$" dontlog
SetEnvIf Request_Method "OPTIONS" dontlog
CustomLog /var/log/apache2/access_log combined env=!dontlog
#ErrorLog  /var/log/apache2/error_log

#Remote logging -- handle by syslog
ErrorLog "|logger -p local3.info -t httperror"
CustomLog "|logger -p local3.info -t http" combined env=!dontlog

LogLevel warn
Run Code Online (Sandbox Code Playgroud)

我真的不想弄乱我无法正确获取日志的地方,但我也不希望每个条目都看到重复的行。目前,如果我提出一个请求,我会看到一行 Apache,然后我认为是 haproxy 将它转发到我的应用程序的一行,类似于:

aa.bbb.ccc.dd - - [05/Oct/2010:02:29:51 +0000] "GET /the_url HTTP/1.1" 200 4 "-" "-"
eee.fff.gg.hh - - [05/Oct/2010:02:29:51 +0000] "GET /the_url HTTP/1.1" 200 4 "-" "-"
aa.bbb.ccc.dd - - [05/Oct/2010:02:31:03 +0000] "GET /another_url HTTP/1.1" …
Run Code Online (Sandbox Code Playgroud)

logging apache-2.2

5
推荐指数
1
解决办法
5646
查看次数

标签 统计

apache-2.2 ×1

bash ×1

fingerprint ×1

known-hosts ×1

logging ×1

ssh ×1