每月彙整: 2005 年 10 月

Mailgraph

mail 流量分析軟體

#cd /usr/ports/mail/mailgraph
#chmod 644 /var/log/maillog
啟動mailgraph
#vim /etc/rc.conf
mailgraph_enable="YES"
#/usr/local/etc/rc.d/mailgraph.ph start

在httpd.conf

     ScriptAlias /cgi-bin/ "/usr/local/www/cgi-bin/"
    <Directory "/usr/local/www/cgi-bin/">
      Options ExecCGI
      AllowOverride None
      Order allow,deny
      Allow from all
    </Directory>

然後就去網頁看你mail 的流量吧~
#因為在/etc/newsyslog.conf 每天會把檔案給renew 所以我們把maillog改成644
過一天後他就會變成640了
所以連newsyslog.conf也要改成644

Samba File perFile and Directory Permissions-Based

Samba 中建檔的權限基礎

File and Directory Permissions-Based Controls

Directory permission-based controls, if misused, can result in considerable difficulty in diagnosing the causes of
misconfiguration. Use them sparingly and carefully. By gradually introducing each, one at a time, undesirable side
effects may be detected. In the event of a problem, always comment all of them out and then gradually reintroduce
them in a controlled way.

Refer to File and Directory Permission Based Controls for information
regarding the parameters that may be used to set file and directory permission-based access controls.

Table 15.3. File and Directory Permission-Based Controls

Control Parameter Description, Action, Notes
create mask

Refer to the smb.conf man page.

directory mask

The octal modes used when converting DOS modes to UNIX modes when creating UNIX directories.
See also directory security mask.

dos filemode

Enabling this parameter allows a user who has write access to the file to modify the permissions on it.

force create mode

This parameter specifies a set of UNIX-mode bit permissions that will always be set on a file created by Samba.

force directory mode

This parameter specifies a set of UNIX-mode bit permissions that will always be set on a directory created by Samba.

force directory security mode

Controls UNIX permission bits modified when a Windows NT client is manipulating UNIX permissions on a directory.

force security mode

Controls UNIX permission bits modified when a Windows NT client manipulates UNIX permissions.

hide unreadable

Prevents clients from seeing the existence of files that cannot be read.

hide unwriteable files

Prevents clients from seeing the existence of files that cannot be written to. Unwritable directories are shown as usual.

nt acl support

This parameter controls whether smbd will attempt to map UNIX permissions into Windows NT ACLs.

security mask

Controls UNIX permission bits modified when a Windows NT client is manipulating the UNIX permissions on a file.

這是從samba 官網貼過來的~~
因為怕自已會忘記~
so 貼過來這

SSH Login Without Password

SSH login without password
Your aim

You want to use Linux and OpenSSH to automize your tasks. Therefore you need an automatic login from host A / user b to Host B / user b. You don't want to enter any passwords, because you want to call ssh from a within a shell script.
How to do it
First log in on A as user a and generate a pair of authentication keys. Do not enter a passphrase:
a@A:~> ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/a/.ssh/id_rsa):
Created directory '/home/a/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/a/.ssh/id_rsa.
Your public key has been saved in /home/a/.ssh/id_rsa.pub.
The key fingerprint is:
3e:4f:05:79:3a:9f:96:7c:3b:ad:e9:58:37:bc:37:e4 a@A

Now use ssh to create a directory ~/.ssh as user b on B. (The directory may already exist, which is fine):
a@A:~> ssh b@localhost mkdir -p .ssh
b@localhost's password:
Finally append a's new public key to b@B:.ssh/authorized_keys and
a@A:~> cat .ssh/id_rsa.pub | ssh b@B 'cat >> .ssh/authorized_keys'
b@B's password:
From now on you can log into B as b from A as a without password:
a@A:~> ssh b@B hostname
B

BY http://linuxproblem.org/art_9.html

兩套perl的問題~

兩套perl在freebsd上~有極大的機會系統會crash
用ftp裝了kern develop distribution的話,都會自動裝上per5.6的版本
而我們在裝很多軟体的時後都是須要perl5.8以上的版本,主要是須要5.8的multistring
所以ports都會自動裝上5.8的版本,這時後問題就來了
因為系統原本就有5.6的版本,然後又裝上5.8的版本,
這時後很多用到perl的程式在執行或是compile的時後很容易出現問題
so
最好的方式是在裝好os 後馬上裝cvsup-without-gui
更新ports後
把舊版的移掉然後裝上新版的
這樣對系統應該是一個比較正確的方式。