
2008年03月
Refuse user to log in
- カテゴリ:
- Linux
If you just make a file /etc/nologin, user would not log in to the Linux.
# cat /etc/nologin
--- backup in progress ---
When you delete the file, user could log in to the Linux again.
How to make an user list
- カテゴリ:
- Linux
All users are listed in a file /etc/passwd.
$ cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
With a command awk, you could get the first field easily.
$ awk -F':' '{ print $1 }' /etc/passwd | sort
adm
apache
bin
Logout automatically
- カテゴリ:
- Linux
It is not recommended that you lease from your PC without logout If you would like to logout automatically, use TMOUT.
This is an example of it. After 300 secondes, bash finish automatically.
$ cat ~/.bashrc
export TMOUT=300
If you write it in a file /etc/profile, all users will be affected.
MPD にも Apple Store
- カテゴリ:
- 旅行
いつの間にやら、というか昨年暮れらしいんですがニューヨークにあるお洒落エリア MPD (Meatpacking District) に Apple Store が出来てました。
Apple Store - West 14th Street
ここは地下鉄で行くには駅からちょっと離れていて不便。だからというか、SOHO あたりに比べて空いてます。そして、広い。
近くにあるスターバックスでコーヒーを飲んでから行ったんだけど、学生らしき若者が当然のように MacBook Pro なんかを使ってるんですよ。くぅ〜生意気なと思うけど、学生は安く買えるんだよね…。私もそれで買ったんだっけ。ちなみにこの日の時点では Air は出荷されていないので、自慢げに使っている人は見られませんでした。
もし地下鉄で行くなら、A C E 線の 14 St. で降りましょう。そのまま 14th Street を西に向かって歩けばたどり着きます。
ちなみに前回書いた BODUM はすでに閉まってました。気に入ってたのに、栄枯盛衰が激しいね。
Give message when users login
- カテゴリ:
- Linux
You could give a message when users login. Make the message in a file /etc/motd (message of the day.)
# cat /etc/motd
This server will reboot within one hour.
User login.
Last login: Sat Mar 8 08:53:21 2008 from windows
This server will reboot within one hour.
$
When you mistype password
- カテゴリ:
- Linux
If you mistype a password when you login, use Ctrl-u. It clears all keys those you typed, then type again.