Monthly Archives: January 2020

Linux – (dash)開頭檔名的刪除

產生一個 “-v” 的檔名 echo hello > -v 或是 touch — -v 註 touch -v 不行 -v會被認為是option 列印內容 cat — -v cat -v 不行,剛好cat -v 是指–show-nonprinting 刪除 rm — -v rm -v不行 -v會被認為是option — 的功能主要是告知 option scanning可以結束,在一般unix程式,option的解析是透過getopt()來處理,在getopt() 單獨的 “–” 參數 代表後面不再當成option。當然,這也只適用於程式是用getopt()來解析arguments的情況。 … Continue reading

Posted in System Administration | Leave a comment

CentOS sshd log

sshd log是透過syslog來處理 ,參考 /etc/ssh/sshd_config設定 實際上記錄到哪一個檔案可查看rsyslog config /etc/rsyslog.conf 上面說明的是 *.info或是更高權限的log記錄到 /var/log/messages,但是mail, authpriv, cron當成no priority。 authpriv log到 /var/log/secure,所以sshd log在CentOS是記錄到 /var/log/secure 參考: https://www.rsyslog.com/doc/v8-stable/configuration/filters.html#selectors The keyword none stands for no priority of the given facility.

Posted in System Administration | Leave a comment