The samba File Server imitates windows file sharing.
Windows Access: \ 192.168.1.200
==========================================================
Samba Port:
Smbd: improve resource access tcp 139 445 for clinet
Nmbd: upd 137 138 with netbios host name resolution
Installation:
1. Check for installation: rpm-qa | grep smaba
2. Mounting the optical drive: mount/dev/cdrom/mnt/cdrom // The optical drive must be mounted first.
3. ls | grep samba under cd/mnt/cdrom/Centos will show samb related files. You only need to install:
Samba MAIN package installation Step 1: rpm-ivh/mnt/cdrom/CentOS/samba-3.0.33tab completion)
Step 2 of samba-common Configuration File Installation: rpm-ivh/mnt/cdrom/CentOS/samba-common tab completion)
Step 3 of samba-client file installation: mount/dev/cdrom/mnt/cdrom/samba-client tab completion)
4. modify the configuration file:
/Etc/samba/smb. conf # And; Are comments)
[Global]
Workgroup = workgroup
Server string = Description
Log file = log location
Max log size = maximum log size KB
Security = user security level
You can set four security levels:
The user logs on with the samba user. Note: samba users are transformed from system users. To generate a user as a samba user, this user must already be a system user
Share Without Password
Server use verification server Verification
Domain Controller Verification
* ********** When using server, domain needs to be set up in addition, not to mention, samba is mainly used for file sharing, and the two do not need to be *****
Share definitions sharing settings
[Home] shared directory name
Comment = directory description
Browseable = yes whether the directory is visible to users who do not have permissions
Writeable = yes the write permission must be equal to the system directory permission. If the system permission settings are not writable, the write permission is not allowed here)
Valid users = user name limit which User owns the Directory), that is, who owns the current directory
Path =/www specify the location of the shared directory
* ******** You do not need to modify all configurations. To create a shared file, you can add ************************* under [Home ********************
Example:
Two directories are shared. One is that all users in/pub can access and all users can upload files.
One is soft location in/soft, which can only be accessed and uploaded by aa users. Other users cannot access
[Pub]
Browseable = yes
Path =/pub
Writable = yes
[Soft]
Browseable = yes
Path =/soft
Writable = yes
* ******** All the Shared Folders can write only these three items. Others are subject to system permission control ************
Mkdir/pub
Mkdir/soft
Chmod 777/pub // change the permission to 777, that is, all users can access and write
Chmod 700/soft // change the permission to 700, that is, only the owner has the permission and other users do not have any permissions.
Chown aa/soft // change the owner of soft to aa
Service smb restart
6) Declare the System user as a samba user
Smbpasswd-a system user name
Smbpasswd-a aa ****** will prompt you to enter the password. It must comply with the smb password rules and be complex to write; otherwise, it will not pass.
Smbpasswd-x user name Delete samba user
7) restart the service
Service smb restart
Note: Obtain the strictest samba and system permissions.
Samba users must be system users.
The service name started is smb.
**************************************** * Password-less access ****************************
After setting security = user, I still prompt to require a password:
Found:
Add:
Guest account = nobody
Guest OK = yes
8) Client usage
Windows: \ 192.168.1.200
* ****** After a user logs on, the user will log on directly next time. to log on again, clear the cache.
Run cmd: net use to View cache
Cmd: net use */del Delete Cache
Linux client:
Smbclient // 192.168.140.253/soft-U aa log on to the linux Server
Smbclient // 192.168.180.250/src-U administrator log on to the windows Server src as the shared directory, no matter how deep the directory is, write src directly)
This article is from the "leesir" blog, please be sure to keep this source http://leezhxing.blog.51cto.com/6634351/1303761