Samba configuration problems

Source: Internet
Author: User
1. Samba Installation Steps

1. Install the RPM packages (samba, samba-common, and samba-client) related to Samba) 2. Create a samba user 3. modify the configuration file 4. Restart the samba Service 5. Set Directory Access Permissions 6. Test
1. Preparations: Our system is the Linux fedroa 19, and the kernel version is 3.14.17-100. fc19.x86 _ 64.
First, use RMP-Qa | grep SMB * to check whether the system has installed the software.

I have installed it on my machine. The software package to be installed is mainly
Samba ----- all files of the Samba server program samba-common ----- provides public files that must be used by both the Samba server and the client samba-client ----- provides all files of the samba client
The installation command I used is yum-install samba *, which is all installed. You can also use the RMP command to install it.
Debian uses apt-install.
Again, because Samba depends on the nmb server, yum-install nmb.
2. Other preparations

The installation package has been prepared and installed. Check whether ports 137, 138, and 139 have been configured in the/etc/services configuration, as shown below:

If so, the next step is to create a samba User:

[[Email protected] ~] # Smbpasswd-a Samba ("-a" is used to create Samba users, and "-X" is used to delete Samba users,
[[Email protected] localhost ~] # Smbpasswd-A user2 "-D" indicates disabling samba with [[email protected] ~] # Smbpasswd-A user3 account, "-e" indicates enabling Samba user account)
After creating a user, modify the configuration file/etc/samba/smb. conf.

Samba servers have five security levels: User, share, server, domain, and ads. When different levels are set, the Samba server also uses the password server and the encrypted password. 1. User ----- the user name and password must be entered when the client accesses the server. After verification, the shared resources of the server can be used. This level uses encrypted transmission passwords. 2. Share ----- the client does not need to enter the user name and password when connecting to the server. 3. Server ----- the client also needs to enter the user name and password when accessing the server. However, the password verification server is responsible for password verification. 4. Domain ----- use the domain controller to authenticate the user. 5. Ads ----- if the Samba server is added to the Windows Active Directory, the ads security level is used. The ads security level must also specify the password server.

[Homes] ----- Samba user's home directory comment = home directories ----- set shared description browseable = No ----- directory browsing permission writable = Yes ----- the user can write this shared directory to the shared directory only by the user it can be used by itself, by default, the user's home directory is located in the/home directory, and each linux user has a subdirectory named after the user name. The following are settings for the shared printer: [printers] ----- shared printer comment = all printers ----- set the shared description Path =/var/spool/samba ----- specify the path of the shared directory browseable = No ----- directory browsing permission guest OK = no ----- allow the guest to access writable = No ----- the user can write printable = yes to the shared directory ----- You can print the above is the system default settings to add a custom shared directory :( user1/Asus ownership, user2 has read-only permission, which is not accessible to other users. The public shared directory allows all users to access and upload files) [Asus] Comment = user1 directories ----- set shared description browseable = Yes ----- all Samba users can see this Directory Writable = Yes ----- users can write Path =/Asus ----- specified path to the shared directory [public] Comment = All User Directories ----- set the shared description browseable = Yes ----- all Samba users can see the Directory Writable = Yes ----- the user can write the path to the shared directory =/Public ----- specify the path of the shared directory guest OK = Yes ----- allow guest access
After all the configurations are ready, you need to re-load the server and restart the server by using service smart restart and service nmb restart.
You must create your own folders at the corresponding location, including/home/directory and/home/folder directory.
Ii. Test

First, test whether the configuration file is correct. Use testparm;

If it is found correct, we continue to use smbclient for testing, and smbclient-l127.0.0.1-u samba for testing.

This is also possible. Finally, we will use Windows for testing.

Iii. Windows Testing

Now we can see our files. If we do not find any, it is likely that the firewall of your Linux system shields the server port and uses iptables-F to view it, but when we open the Asus, the problem arises.

In this case, the folder cannot be opened because the permission of our folder is incorrect, even if the permission of the directory you set is 777, however, if the upper-level folder limits your permissions, you cannot open the folder. For example, if the/home permission is 700 and the home folder directory is 777, you still cannot open the folder, now we need to use chmod 777/home.

It is already in, but if you want to create a file at this time, it will not work, it will tell you that you do not have the permission to do this work.

Why is it wrong? At that time, because our system's SELinux settings were incorrect, this setting blocks the path for me, so we need to set it.
Setenforce 0 sets SELinux to permissive mode. In the beginning, our system is setenforce 1 sets SELinux to enforcing mode.

Now you can put things in it.

It's really not easy! This is also something that I configured for a long time. I hope this will be useful to everyone.

Reference: http://yangxuejun.blog.51cto.com/623927/180224
Http://blog.csdn.net/jiusifeng/article/details/7413377


Samba configuration problems

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.