QUOTA設定

12 07 2008

quotaパッケージのインストール

* # yum -y install quota

/etc/fstabの設定(/home以下をユーザ毎に制限する場合)

* # vi /etc/fstab
/dev/sda5 /home ext3 defaults 0 0 2(変更前)
/dev/sda5 /home ext3 defaults,usrquota 0 2(変更後)

ファイルシステムのリマウント

* # mount -o remount /dev/sda5

マウント状況を確認

* # mount
/dev/sda5 on /home type ext3 (rw,usrquota)

quotaファイルの作成

* # touch /home/aquota.user
* # chmod 600 /home/aquota.user

quotaファイルの初期化

* # quotacheck -muv /home
* # quotaon -auv

使用可能なディスク容量の設定(100MBの場合)

* # edquota somebody
Disk quotas for user somebody (uid 10000):
Filesystem blocks soft hard inodes soft hard
/dev/hdb1 3332 0 1024000 51 0 0





SSH

12 07 2008

1. Cài đặt SSH
2. Khởi động
#service sshd start
#chkconfig sshd on

3. Giới hạn access
#vi /etc/hosts.allow
thêm vào
sshd: ALL

4. Đăng ký User
$ssh -l username host
Nhập password cho SSH (không nhất thiết phải giống với pass của user)

$ssh-keygen -t rsa
Nhập pass vừa đăng ký ở trên

Xác nhận key được tạo ra:
$ls -l .ssh/
$ssh-keygen -l -f .ssh/id_rsa.pub

5. Thêm username@host vào trong file id_rsa.pub
$scp ~/.ssh/id_rsa.pub username@host:

6. Tạo file key của client
$cat id_rsa.pub >> ~/.ssh/authorized_keys
$chmod 700 ~/.ssh
$chmod 600 ~/.ssh/authorized_keys

7. Test
Từ máy client thử truy cập server
$ssh -l username host