トップ «前の日記(2007-12-10(Mon)) 最新 次の日記(2007-12-12(Wed))» 編集

屑俺日記

僕の備忘録(PC、UN*X、ネットワーク関連が中心)なんです。
自分の書いたところは適当(な時とか)に書き換えますので御了承を。


2007-12-11(Tue) やゆよらりるれろ

不正なユーザ

流石にsshdをすべてのIPアドレスに(すべてのユーザに、ではない。念のため) 解放しておくのは馬鹿馬鹿しい。

host:/var/log# grep Invalid auth.log | \
  awk '{print $8}' | sort | uniq -c | \
  sort -n | tail -n10
     48 test123
     48 test4
     49 test2
     49 test3
     53 testuser
     54 test1
     57 admin
     67 tester
     68 testing
    107 test

"linux"はあったが、"bsd"などはなかった。
日本語名らしいものも、まだ。
ちなみにアタックしてきた香具師は、

   2156 202.67.217.130
    472 211.251.207.129
    147 220.197.222.27
    134 211.20.42.226
     13 203.145.184.186

inotify-tools

inotify-watchとinotify-waitがある。
まずwatchの方を。

host:~$ tty
/dev/pts/0
host:~$ touch newfile
 
host:~$ inotifywatch newfile
Establishing watches...^c
Finished establishing watches, now collecting statistics.
total  modify  close_write  open  delete_self  filename
6      2       1            1     1            newfile

↑を^cで止めるまでに、別端末からいくつか。

host:~$ tty
/dev/pts/1
host:~$ ls newfile
newfile
host:~$ ls > newfile
host:~$ ls newfile
newfile
host:~$ ls  -l newfile
-rw-r--r-- 1 user group 1763 12月 11日 16:50 newfile
host:~$ rm newfile

ls(1)

ls -l で表示される2番目のエントリは、「リンクの数」 だった。これはシンボリックリンクではない。

host:~$ touch newfile
 
host:~$ ls -l newfile
-rw-r--r--  1 user group 0 12月 11日  17:07 newfile
host:~$ ln -s newfile newsym
host:~$ ls -l newfile
-rw-r--r--  1 user group 0 12月 11日  17:07 newfile
 
host:~$ ln    newfile newhard
host:~$ ls -l newfile
-rw-r--r--  2 user group 0 12月 11日  17:07 newfile

リンクはご自由にどうぞ。でもURLや内容が変った場合はあしからず。

index.htmlは ここから。