Set up a batch of folders and create a user _ftp server for Serv_u batch

Source: Internet
Author: User
Tags ini mkdir
Look at the Internet, also did not find a good way. No way, can only take out the old with Doc established.

Method steps.

1. Create a folder for each account first.

Account if there is a rule of words that say, such as: ftp001, ftp001 ... ftp100, directly in Excel can be generated automatically, and then the resulting account into a TXT file, a line of an account. If it is not regular, there is no way, only one input.

2. Prepare the Account.txt file of this account, create a Run.bat file, open the file, enter the code

@for/F%%i in (account.txt) do @mkdir%%i

Pause

Save it as Run.bat and then double-click to run it to produce all the directories in the Account.txt file.

Explanation:/F is to ignore the account file in the blank line, Account.txt is just the establishment of the accounts file, mkdir is the establishment of a directory Doc command,%%i is to get account.txt a row of accounts, that is, the name of the directory. This is a simple for loop

3. If you want to bulk copy the same file to the directory you just created, just add that run.bat file just one sentence.

For example: @for/F%%i in (account.txt) do @copy index.htm%%i This is a copy index.htm to all the directories that have just been created, simply.

With two, you can actually solve a lot of problems.

4. To synthesize. If you want to set up an FTP account, want to put a file in each user's directory, such as I think of each just set up the account folder in a TXT file, prompting users to modify the password in a timely manner. So, to do this, create a new bat file and enter:

@for/F%%i in (bm.txt) do @echo The default user name is%%i, password 123456, and after obtaining the account, please change the password in time through Doc >%%i/%%i.txt
Pause

In each user folder, add a file named "Current account. txt" and the contents of the file, as shown in the Chinese characters above.

5. OK, the account file is set up, how to set up an FTP account? I use serv u, open serv u file, in which you will find a Servudaemon.ini file, open him you will find! O! Originally all the users are here ah, it is good to do, careful observation you will find that there is a very regular. See User1 、、、 User2 ... , as follows:

User1=dzz|1|0
User2=tzz|1|0
User3=jk|1|0
User4=dx|1|0


And his password, permission to wait.

[User=dzz|1]
Password=fje371f8a2f2655daff87f257342b6ec4c
Homedir=d:\departmenthtmls\dzz
Relpaths=1
Changepassword=1
Diskquota=1|20971520|0
passwordlastchange=1239339982
timeout=600
access1=d:\departmenthtmls\dzz| Rwamlcdp

You must have read it, I presume.

That's good to do, we can directly use Doc to generate the above user1=xxx|1|0, and his permission file, and then copied to the Servudaemon.ini file on the line.

But there is a problem, is that all the account password is the same, should be for the account inside the encryption, we first set up an account, remember his password ciphertext, and then all the other accounts with this redaction on the line.

6. How to generate the above account file? I think of a need to explain it, the method is everywhere, with Excel, Batch command, database commands, and so on.

7. How to modify the password, in the client landing ftp to change the password or to rely on doc

1. Run cmd
2. Enter Command FTP
3. Enter Open IP
4. Enter your username
5. Enter your password
6. System Prompts Login success
7. Modify password, quote "site pswd old password new password"--------Don't miss quotes
8. System Prompts password modification successful

Hint: The user must have permission to modify the password.

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.