サーバーを運営管理するならiptablesとunixコマンドの基礎知識が必須。
iptables
iptablesとはLinux系OSに標準搭載されているファイヤーウォール。
設定することで通信に使うポートを制限することができる。
shutdown
shutdownを行うとシステムを安全に終了させる。
実行すると、既にログインしているユーザに終了メッセージが伝えられ、新規ログインもできなくなる。
【使い方】
shutdown [オプション] [停止時間] [メッセージ]
例 待機時間なしですぐにシャットダウン。
[root@localhost test]# shutdown -h now
例 1分後に再起動。
[root@localhost test]# shutdown -r 1
service
サービスを開始するときに使用する。
/etc/init.d/ にあるスクリプトを起動する。
【使い方】
service [開始するサービスの名称] [オプション]
例 httpdを開始する
[root@localhost test]# service httpd start
例 httpdを停止する
[root@localhost test]# service httpd stop
【補足】
すべての起動しているサービスの状態をしらべたいときは
「--status-all」 オプションが便利
例 すべてのサービスの状態を調べる。
[root@localhost test]#service --status-all
useradd
新規ユーザーの追加を行う。
【使い方】
useradd [オプション] [ユーザ名]
例 新入生のグループに[na__ga]を追加
[root@localhost test]# useradd -g Fresh na__ga
passwd
アカウントへのパスワードの設定を行う。
【使い方】
passwd [ユーザ名]
例 [na__ga]がログインする際に使用するパスワードを設定する。
[root@localhost test]# passwd na__ga
passwd na__ga
Changing password for user na__ga
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully.←これで成功
userdel
ユーザーアカウントの削除を行う。
【使い方】
userdel [オプション] [ユーザ名]
例 [na__ga]を削除する。
[root@localhost test]# userdel na__ga
find
ディレクトリやファイルの検索を行う。
【使い方】
find [オプション] [検索するファイルやディレクトリ]
例 testを検索する。
[root@localhost test]# find /etc/ test
例 test.zipを検索して一覧にして表示する。
[root@localhost test]# find /etc/ -name "test.zip" -ls
例 1日以内に更新されたファイルを探す。
[root@localhost test]# find / -mtime -1 -print
whereis
コマンドのバイナリ、ソース、マニュアル等のパスを表示する。
【使い方】
whereis [オプション] [検索したいコマンド]
例 lsを検索する。
[root@localhost test]# whereis ls
例 lsのマニュアルを検索する。
[root@localhost test]# whereis ls -m
chmod
df
top
- chmod?? -- oka (2011-04-16 12:57:03)
最終更新:2011年04月30日 00:43