1. Install Samba (CentOS 5.5):
The code is as follows:
Yum Install samba System-config-samba samba-client Samba-common
2. Create WWW account
The code is as follows:
/usr/sbin/useradd www
Mkdir-p/data/www
chmod 777/data/www
Chown-r www:www/data/www
cat/etc/passwd | Mksmbpasswd.sh>/etc/samba/smbpasswd
3. Create Samba configuration file
The code is as follows:
Mv-f/etc/samba/smb.conf/etc/samba/smb.conf.bak
Vi/etc/samba/smb.conf
As follows:
The code is as follows:
[Global]
Server string = Samba Server
Security = User
Encrypt passwords = yes
SMB passwd file =/etc/samba/smbpasswd
[web]
Workgroup = www
NetBIOS name = www
Path =/data/www
browseable = yes
writeable = yes
4. Set a password for the samba user www:
The code is as follows:
Smbpasswd-a www
5. Start Samba:
The code is as follows:
/sbin/service SMB Start
6. Test in Windows Client
The code is as follows:
192.168.8.32web
Enter user name www and password in the pop-up authentication window (tick remember my password) ok
7. Map the Linux directory shared by Samba to a drive letter in Windows:
My Computer right button--> mapped network drive--> Select a drive letter that is not used, enter 192.168.8.32web in the folder, check the connection again when you log on (this will automatically connect after you restart the computer), and then enter--> Enter username www and password (tick remember my password) OK, okay.