Comprehensive application cases of Samba server and vsftpd Server

Source: Internet
Author: User
Samba server and vsftpd server comprehensive application case-general Linux technology-Linux technology and application information, the following is a detailed description. Tutorial steps:

I. installation and configuration of Samba Server
By default, all the software packages of the Samba server and client are installed in RHEL4. before using the software, make sure that these software packages already exist in the system. The RPM installation packages of the Samba server and client are kept in the 2nd installation discs of RHEL4. You can use the rpm command to install or reinstall the installation.


Edit the main configuration file smb. conf of Samba


Modify security = share. This option is used to determine the user authentication method used by the Samba server for the client. The default mode is user authentication, that is, the user name and password must be used for authentication to enter the corresponding directory, all users are required to access the shared resources on the Samba server without entering the user name and password. Therefore, the share parameter is used to access the Samba server without entering the user name and password.


Comment out the configuration lines under [homes] and prohibit all users from logging on to the Samba server through the Samba user account. Because the Samba server in an Internet cafe does not need to create a shared directory for each user, you only need to have a public shared directory.


To add public directories [movies] and [games], you must have the permission to access public directories and read only,
Path =/home/wangba/movies: Set the Linux system directory corresponding to the public directory. This directory is created when a vsftp server is created.
Public = yes indicates that the shared directory is visible to all Samba users.
Only guest = yes indicates that the user identity of all users in this directory is guest, that is, the Linux system user nobody.
Guest OK = yes indicates that all anonymous users are allowed to log on.
Writable = no indicates that the shared directory is not writable to all users.


Ii. Vsftp server configuration process
First, mount the first disc and install the RPM installation package of the vsftpd server.


Modify vsftpd's main configuration file vsftpd. conf


You only need to set the option anonymous_enable to NO and add chroot_local_user = YES. That is to say, anonymous users are not allowed to access the FTP server, which increases the security of the FTP server, and lock all logged-on users to their home directories. You can use other default values.


Create a new user wangba on the Vsftpd server, set the password, and log on to the FTP server.


Add the movies and games folders to the user's home directory wangba, and change the owner to wangba. And view its permissions, only allow all users to read and execute permissions.


After the configuration is complete, restart the vsftpd and samba services to make the modifications to smb. conf and vsftpd. conf take effect.


3. Test whether wangba can access the vsftp server.


After the test is successful, you can create the required directories in the games directory, such as World of Warcraft and hot blood.


All users can access the Samba server using the UNC path, but garbled characters are displayed in games, which is caused by different encodings supported by the Samba server and FTP.


4. Solve the Problem of Chinese synchronization between Samba server and FTP
Open the main configuration file smb of the Samba server. conf, add the dos charset = gb2312 and unix charset = gb2312 records to the global directory [global], and restart the Samba service to take effect.


Then access the Samba server using the UNC path again. We can see that the Chinese Garbled text just displayed has been fixed.


V. Solve the Chinese issue of public directories on Samba servers
As we all know, Chinese characters cannot be entered on the Linux character interface, and garbled characters are displayed when entered. How can we display Chinese characters in the [movies] and [games] directories, this requires the smb. the conf configuration file is extracted to the Windows environment and modified to Chinese, and then overwrite the previous configuration file.
There are many ways to extract files from Linux to Windows. Here you can copy smb. conf to the FTP directory and then download the files using ftp in Windows.



After copying the file to a Windows environment, you can use the WordPad or technical book to open the file smb. conf and change [movies] to [video channel] and [games] to [game world].


After the modification is completed, it will only be uploaded to the FTP server and overwritten to the default directory by using the cp command in Linux.


You can view the smb. conf directory, and you can see garbled characters.


After the modification, restart the smb service.


In windows, accessing the shared directory through ftp is displayed as English subtitles. Access through the UNC path can be displayed as Chinese


Log on to the FTP server using the wangba user, create a file, and access the file using the UNC path. The test is successful.
Related Article

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.