古いSambaを削除
cd /etc rm -r -f samba
インストール
apt-get update apt-get install samba apt-get clean
完了
設定ファイル:/etc/smb.conf
passwdファイル:/etc/smbpasswd
cat /etc/passwd | /usr/bin/mksmbpasswd.sh > /etc/smbpasswd chmod 600 /etc/smbpasswd ←rootだけ読み書きOK smbpasswd ********* ←ユーザーを作る(*はユーザー名)
encrypt passwd = yes smb passwd file = /etc/smbpasswd
/etc/init.d/smb start
chkconfig smb on
chkconfig --list smb smb 0:off 1:off 2:0ff 3:on 4:on 5:on 6:off
以下smb.conf例
# Samba config file created using SWAT # from 192.168.0.17 (192.168.0.17) # Date: 2005/04/14 15:32:47 # Global parameters [global] coding system = euc client code page = 932 workgroup = **** ←Windowsと同じワークグループにする netbios name = KURO-BOX ←/etc/hostsに書いてある名前に合わせる hosts allow = 192.168.0. ←192.168.0.*がアクセス出来るようになる server string = %L: Samba %v on %h encrypt passwords = Yes passwd program = /usr/bin/passwd %u passwd chat = *New*password* %n\n *Re*new*password* %n\n *success* unix password sync = Yes log file = /var/log/samba/log.%m max log size = 50 deadtime = 15 read size = 65536 socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192 add user script = /usr/sbin/useradd %u lm announce = No dns proxy = No wins support = Yes winbind uid = 10000-20000 winbind gid = 10000-20000 printer admin = administrator printing = lprng lppause command = lpc hold %p %j lpresume command = lpc release %p %j queuepause command = lpc stop %p queueresume command = lpc start %p dos filetimes = Yes dos filetime resolution = Yes [homes] ←これはlogin user用のディレクトリ設定 comment = %S's Home Directories writeable = Yes browseable = No [hoge] ←これでhogeというグループのみが入れるディレクトリが出来る comment = hoge path = /mnt/home/hoge valid users = @hoge writeable = Yes force group = hoge force user = root [www] ←HTMLを置くディレクトリも作る。webadminグループのみ入れる comment = home pages root path = /mnt/www public = yes ;guest ok = yes read onry = no create mask = 644 directory mode =755 delete veto files = yes veto files = /\.*/ valid users = @webadmin writeable = Yes force user = root [etc files] ←誰でも入れる共有スペース comment = All users File path = /mnt/home/etcfile writeable = Yes guest ok = Yes hosts allow = 192.168.0. force user = root
/etc/smb.confの編集保存が終わったら、Sambaを再起動する。
Samba インストール後、設定ファイル/etc/inetd.conf に以下の記述があればよい
swat stream tcp nowait.400 root /usr/sbin/swat swat
またサービスとして起動するために設定ファイル/etc/servicesに
swat 901/tcp # Samba Wab Administration Tool
の記述が有効になっていればOKです。
このあとinetdのリスタートが必要
/etc/rc.d/init.d/inet restart
"http://玄箱のアドレス:901/"を開くとSWATのユーザ認証ダイアログが出ますので玄箱のスーパーユーザーのID,Passwordを入力すれば設定画面が開きます。
あとはブラウザでURLを"http://Samba-2.0.0が動いてるマシン:901/"と指定するとパスワードの入力を要求されますので、rootでログインすれば、Sambaの設定を変更したり出来ます。