Comprehensive application cases of Samba server and vsftpd server for Internet cafes

Source: Internet
Author: User
Tags server installation and configuration

Tutorial Background:An Internet cafe needs to build a SambaServer. The specific requirements are as follows: 1. the Samba server acts as a file server for Internet cafes. It requires movies and games to be provided to all users, and there is no shared directory for private users. 2. All common users are required to view and use only files on the Samba server. Files cannot be modified or deleted. 3. The file update process on the Samba server must be performed on a vsftp server. 4. The main folder created on the Samba server is required to contain Chinese characters, such as [game world] and [music world. 5. The file directories that need to be uploaded through the FTP server, for example, [World of Warcraft] and [Running karting] are displayed as Chinese.Tutorial steps:I,SambaDuring Server installation and configuration, all the software packages of the Samba server and client are installed in RHEL4 by default. Make sure these software packages already exist in the system before use. 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 of Samba. conf: modify security = share. This option is used to determine the user authentication method the Samba server uses for the client. The default mode is user authentication, that is, you must pass the user name and password verification to access the corresponding directory. Now, 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, you can access the Samba server without entering the username 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. Onlyguest = yes indicates that the identity of all users in this directory is guest, that is, the Linux system user nobody. Guestok = 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,VsftpFirst, mount the first CD and install the RPM installation package of the vsftpd server. Modify the main configuration file vsftpd of vsftpd. conf only needs 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. In this way, security can be increased, 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.III,Test user wangbaAccess 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.IV,Solve SambaServer and FTPFor Chinese synchronization problems, open the main configuration file smb of the Samba server. conf, add the doscharset = gb2312 and unixcharset = 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 SambaAs we all know about the Chinese character of the public directory on the server, Chinese characters cannot be entered on the Linux character interface. If entered, only garbled characters are displayed, so how can we display the [movies] and [games] directories in Chinese? This requires 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. in Linux, the smb. conf directory can be viewed by overwriting the default directory through the cp command. The garbled characters are displayed. 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 a Chinese test using the wangba user to log on to the FTP server, create a file, and then access through the UNC path, you can see that the test is successful.

This article is from the blog of "the Linux open source technology blog", please be sure to keep this source http://dreamfire.blog.51cto.com/418026/164089

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.