http://www.gnu.org/software/libiconv/
tar xzvf libiconv-1.9.1.tar.gz
http://www2d.biglobe.ne.jp/~msyk/software/libiconv-patch.html
zcat libiconv-1.9.1-cp932.patch.gz | patch -p0
gunzip libiconv-1.9.1-cp932.patch.gz gpatch -p0 < libiconv-1.9.1-cp932.patch
cd libiconv-1.9.1 ./configure --prefix=/usr/local make make instal
iconv -l | egrep -i '(-31j|-ms)'
CP932 MS932 SHIFFT_JIS-MS SJIS-MS SJIS-OPEN SJIS-WIN WINDOWS-31J WINDOWS-932 CSWINDOWS31J ISO-2022-JP-MS
ldconfig
init_iconv: Conversion from eucjp-ms to UTF-16LE not supported
rpm -q samba
rpm -e samba
rpm -e --nodeps samba
tar xzvf samba-3.0.13.tar.gz cd samba-3.0.13/source ./configure --with-libiconv=/usr/local --with-utmp --with-pam make make install
./configure --with-libiconv=/usr/local --with-utmp --with-pam --with-automount --with-smbmount --with-quotas --with-acl-support --with-ldap --with-ads --with-winbind --with-syslog
unix charset = EUC-JP dos charset = CP932 display charset = CP932
http://www.atmarkit.co.jp/flinux/special/samba3b/samba03.html
/usr/local/samba/sbin/smbd -D /usr/local/samba/sbin/nmbd -D
netstat -nplt
netstat -nplu
ps aux |grep smbd
/usr/local/samba/bin/testparm
auth required pam_nologin.so auth required pam_stack.so service=system-auth account required pam_stack.so service=system-auth session required pam_stack.so service=system-auth password required pam_stack.so service=system-auth
http://www.monyo.com/technical/samba/translation/samba30/html/smb.conf.5.html
/etc/init.d/smb
chkconfig --list |grep smb
chkconfig --add smb chkconfig --level 345 smb on
service swat { port = 901 wait = no only_from = 192.168.1.0/24 socket_type = stream user = root server = /usr/local/samba/sbin/swat log_on_failure += USERID disable = no }
/etc/init.d/xinetd restart
yum -y install xinetd
401 Bad Authorization
smb_pam_passcheck: PAM: smb_pam_auth failed - Rejecting User root !
unix charset = EUCJP-MS display charset = EUCJP-MS
[hoge] read only = No hosts allow = 192.168.1.0/24
/usr/local/samba/bin/smbclient //localhost/hoge -U hoge1
/usr/local/samba/bin/smbpasswd -a test
useradd test /usr/local/samba/bin/pdbedit -a test
/usr/local/samba/bin/pdbedit -r test
/usr/local/samba/bin/pdbedit -x test
pdbedit -L -v
/usr/local/samba/bin/smbpasswd usrid password
printf "hoge\nhoge\n" |/usr/local/samba/bin/smbpasswd -sa test
wget http://optusnet.dl.sourceforge.net/sourceforge/openantivirus/samba-vscan-0.3.6b.tar.bz2 tar xjf samba-vscan-0.3.6b.tar.bz2 cd samba-vscan-0.3.6b
make make install cp ./clamav/vscan-clamav.conf /usr/local/samba/lib/
clamd socket name = /var/run/clamd
clamd socket name = /tmp/clamd
[hoge] path = /hoge admin users = root read only = No valid users = hogeuser1 hosts allow = 192.168.1.0/24 vfs objects = vscan-clamav vscan-clamav: config-file = /usr/local/samba/lib/vscan-clamav.conf
http://www.eicar.org/anti_virus_test_file.htm
Scan result: '//work/eicar.com' infected with virus 'Eicar-Test-Signature', client: '192.168.1.1'
infected file action = quarantine quarantine directory = /viruschk
mkdir /viruschk
cp examples/LDAP/samba.schema /usr/local/etc/openldap/schema/
include /usr/local/etc/openldap/schema/core.schema include /usr/local/etc/openldap/schema/cosine.schema include /usr/local/etc/openldap/schema/inetorgperson.schema include /usr/local/etc/openldap/schema/nis.schema include /usr/local/etc/openldap/schema/samba.schema
dn: dc=hoge,dc=jp objectClass: dcObject objectClass: organization dc: hoge o: hoge dn: cn=Manager,dc=hoge,dc=jp objectClass: organizationalRole cn: Manager
ldapadd -x -D 'cn=Manager,dc=hoge,dc=jp' -W -f init.ldif
index objectClass,uidNumber,gidNumber,uid,sambaSID,cn,memberuid eq
SmbHash?
perl -MCPAN -e shell install Net::LDAP
install Crypt::SmbHash install Unicode::MapUTF8 install Convert::ASN1 install IO::Socket::SSL
force install IO::Socket::SSL
mkdir /etc/smbldap-tools cp *.conf /etc/smbldap-tools/ chmod 644 /etc/smbldap-tools/smbldap.conf chmod 600 /etc/smbldap-tools/smbldap_bind.conf cp smbldap-* /usr/local/sbin/ cp smbldap_tools.pm /usr/local/sbin chmod 775 /usr/local/sbin/smbldap-* chmod 775 /usr/local/sbin/smbldap_tools.pm
net getlocalsid
masterLDAP="127.0.0.1" masterPort="389" suffix="dc=hoge,dc=jp" sambaUnixIdPooldn="sambaDomainName=${sambaDomain},${suffix}" userSmbHome="\\Hoge-SV\%U" userProfile="\\Hoge-SV\profiles\%U" userHomeDrive="H:" userScript="logon.bat" mailDomain="hoge.jp"
slaveDN="cn=Manager,dc=hoge,dc=jp" slavePw="secret" masterDN="cn=Manager,dc=hoge,dc=jp" masterPw="secret"
ERROR: 'ldap admin dn' not defined! Please check your smb.conf
smbldap-populate
[2008/04/25 18:53:14, 0] lib/smbldap.c:smbldap_connect_system(982) failed to bind to server ldap://127.0.0.1/ with dn="cn=Manager,dc=hoge,dc=jp" Error: Invalid credentials
log level = 0
[(&(|(objectclass=sambaGroupMapping)(sambaGroupType=4))(|(sambaSIDList=S-1-5-21-201613407-4078079238-3289816433-3006) (sambaSIDList=S-1-22-2-1003)(sambaSIDList=S-1-1-0)(sambaSIDList=S-1-5-2)(sambaSIDList=S-1-5-11)))], scope => [2]
Apr 29 02:54:17 hogepc slapd[4487]: bdb_db_open: Database cannot be opened, err 13. Restore from backup!
rm -rf /usr/local/var/openldap-data mkdir /usr/local/var/openldap-data
chown -R ldap:ldap /usr/local/var/openldap-data
smbd/chgpasswd.c:expect
passwd chat = "Changing password for*\nNew password*" %n\n "*Retype new password*" %n\n"
passwd chat = *New* %n\n *Retype* %n\n
logon path = \\%L\profiles\%U [profiles] path = /home/profiles
chown 777 profiles
write_socket_data: write failure. Error = Connection reset by peer lib/util_sock.c:write_socket(413) write_socket: Error writing 4 bytes to socket 7: ERRNO = Connection reset by peer
http://www.samba.gr.jp/ml/article/samba-jp/msg15693.html
/usr/local/samba/bin/smbmount //hogepc/work /mnt/test/ -o username=hoge,password=hogepass,ip192.168.1.1
mount -t cifs //hogepc/work /mnt/test -o username=hoge,password=hogepass
unix password sync = Yes passwd program = /usr/bin/passwd %u
unix password sync = Yes pam password change = Yes
log file = /var/log/samba/%m.log
log level = 2
recycle bin = .recycle
vfs objects = recycle
recycle:keeptree = yes recycle:versions = yes
http://www.atmarkit.co.jp/flinux/rensai/linuxtips/734recycle3.html
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
socket options = TCP_NODELAY SO_RCVBUF=65535 SO_SNDBUF=65535
http://www.katontech.com/diary/?date=20050203
http://www.atmarkit.co.jp/flinux/special/samba3b/samba02.html