Configure the FTP service and the read/write SAMBA service in Ubuntu server 9.04

Source: Internet
Author: User
Tags ftp file

I have been busy over the past few days, and I have not updated my blog. I just finished my work. I 'd like to summarize it briefly. Recently, the company has switched a large number of services to Linux. All development machines have been replaced with Ubuntu 9.04 desktop. We are responsible for assembling about 8 machines, in the afternoon, the previous company's servers will be updated. In the past, two servers in the company used Red Hat EL4. I went to SSH and found that the FTP server was not used to it. I found that the vsftp server was installed on it, however, it cannot be started, but the remote FTP can be logged on and cannot be uploaded. I was puzzled. After reading the information, I found that Redhat EL4 enabled the default gssftp at the same time, I stopped him first, and then started the FTP service using service vsftpd start. However, I was unable to upload the file. I checked the permission and other reasons for failure. Finally, the DF command saved me, huge depressing, space occupied by 100%, Hard Disk Full, careless price. I browsed the two servers, but there were not many important things. I used Ubuntu server 9.04 to redo it for future management convenience. The following describes the entire process.

The server is our own inspur server, 80 GB hard disk, 2 GB memory, dual-core Intel CPU. There are a lot of online installation processes, that is, the graphic interface, without the Installation Wizard of desktop beautiful, but it can also guide the smooth completion of installation. After the installation is complete, restart the machine, enter the console, enter the user name and password, and start configuring the service.

1. Configure vsftpd to implement the FTP service.

Install vsftpd first, and install vsftpd on sudo apt-Get under Ubuntu. After a while, the vsftpd is installed and the FTP service is automatically started. After the configuration is completed, the/etc/vsftpd. conf file is the configuration file of vsftpd. Let's configure sudo Vim/etc/vsftpd. conf. The following describes the detailed parameters of the file:

######################################## ######################## Accept anonymous users anonymous_enable = yes # do not ask for the password no_anon_password when anonymous users log in = Yes # accept local user local_enable = yes # can be uploaded (global control ). if you want anonymous users to upload files, set anon_upload_enable = yes. # If you want anonymous users to create directories, set anon_mkdir_write_enable = yes. # Upload by anonymous users is prohibited, so these two items are not set. write_enable = yes # umasklocal_umask = 022 # Welcome Message ftpd_banner = welcome to kingarthur's FTP service when a local user uploads a file. # The directory where the local user login is located. If this item is not set, the local user login will be # In his home directory (the sixth field of/etc/passwd. the option for anonymous users is anon_rootlocal_root =/var/FTP # If set to yes, the following controls are valid: chroot_list_enable = yes # If no, the file specified by the chroot_list_file option is recorded (/etc #/vsftpd by default. in chroot_list), the user will be in the directory where the chroot is logged on, and cannot leave. if yes, the logged user will not be chroot. select Yes here. chroot_local_user = yes # The server runs in standalong mode, so that the following control can be performed: Listen = Yes

The above are all the parameters I opened, and their basic functions are complete. Both the local user and anonymous user can log on, and the FTP file will be placed under/var/FTP. You have created/etc/vsftpd. in the chroom_list file, put the username you have prepared for local login into this file. When they log on, they will use/var/FTP as the root directory, after logging on to FTP, the user cannot see the directory structure of the entire system, which is relatively secure. Here we will create a new user named ftpmanager. As a special FTP user, he will add his name to vsftpd. chroom_list.

Sudo groupadd ftpusersudo useradd-G ftpuser-D/var/FTP ftpmanagersudo passwd ftpmanager // set the password chown ftpmanager/var/FTP // complete the permission settings, in this way, the user can read and write chmod 777/var/FTP to this directory.

Run the sudo service vsftpd restart command to restart the server, and then log on with ftpmanager to upload the file.

2. Configure to read and write samba, mainly for the VSS file server

First, install Samba:

 
Sudo apt-Get install sambasudo apt-Get install smbfs

Next, let's share the readable and writable folders of the group. Assume that the folder you want to share is/var/VSS. First, create this folder.

 
Mkdir/var/vsschmod 777/var/VSS

Back up and edit smb. conf to allow network users to access

 
Sudo CP/etc/samba/smb. conf/etc/samba/smb. conf_backupsudo Vim/etc/samba/smb. conf

Search for this line of text in VIM/sercurity

 
; Security = user

Replace the following rows

 
Security = userusername map =/etc/samba/smbusers

Add the following lines to the end of the file. Assume that the user allowed to access the file is vssuser. The shared folder name is VSS.

[VSS] Comment = VSS folder for VSS file serverpath =/var/vsspublic = yeswritable = yesvalid users = nvssusercreate mask = 0700 directory mask = 0700 Force user = nobodyforce group = nogroupavailable = yesbrowseable = yes

And change [Global]

 
Workgroup = workgroupdisplay charset = UTF-8unix charset = UTF-8dos charset = cp936

The following three lines are used to prevent Chinese directory garbled characters. Depending on your local, the UTF-8 may need to be changed to cp936. Now you need to add the network access account vssuser. If this account does not exist in the system

 
Sudo useradd vssuser

Note that the user vssuser has been added, but the user has not been given a local logon password. Therefore, this user can only be remotely accessed and cannot log on from the local machine. In addition, the samba logon password can be different from the local logon password. Now you want to add a network user account:

 
Sudo smbpasswd-A vssusersudo Vim/etc/samba/smbusers

Add the following line to the newly created file to save

 
Vssuser = "VSS user name"

Run the command to delete the account of a network user and change-a to-X.

 
Sudo testparmsudo/etc/init. d/samba restart

Finally, log out and log on again or restart the machine.

3. Map the samba shared network disk under Windows

Right-click my computer, select ing network drive, select drive letter, enter the samba shared directory, check logon reconnect, click another user name to connect and enter the samba account. The above method is normal in the Win2k system, but the system above XP will have a normal connection but cannot be connected after logon. The following solution:

 
1. Choose Control Panel> User Account> select a user> Manage My network password> Add and enter the IP address and account of the Samba server, then, remap the samba shared directory, and automatically reconnect without the need to use another user name for connection. 2. If the network password option is not available, choose Start> Settings> Control Panel> Administrative Tools> Local Security Policies> Local Policies> Security Options> network access: do not store creden for network identity authentication or. NET passports, set it to disabled. Restart the system and you will be able to see manage my network password-> Add options, and then follow the 1st settings.

4. There will be another server to handle tomorrow. I'm depressed. I don't know what services I want to make.

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.