Home Operation and Maintenance Linux Operation and Maintenance About how to upload files to linux server via ftp on windows desktop

About how to upload files to linux server via ftp on windows desktop

Jun 04, 2017 am 11:19 AM

This article mainly introduces how to use ftp on the windows desktop to upload files to the linux server. Friends in need can refer to it

First of all, Install ftp

[root@host2 test]#yum -y install ftp vsftpd
[root@host2 test]#service vsftpd start
[root@host2 test]#chkconfig vsftpd --list   
[root@host2 test]#/etc/init.d/iptables stop    
[root@host2 test]# ftp 192.168.0.142
Connected to 192.168.0.142 (192.168.0.142).
220 (vsFTPd 2.2.2)
Name (192.168.0.142:root): ftp    
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> cd pub
250 Directory successfully changed.
ftp> put /root/test/test.txt 
local: /root/test/test.txt remote: /root/test/test.txt
227 Entering Passive Mode (192,168,0,142,140,140).
550 Permission denied.  
ftp> quit
221 Goodbye.
//直接安装起服务,使用匿名登录后,上传文件会提示拒绝访问,这时我们需要修改一些文件
[root@host2 test]# getsebool -a | grep ftp
allow_ftpd_anon_write --> off
allow_ftpd_full_access --> off
allow_ftpd_use_cifs --> off
allow_ftpd_use_nfs --> off
ftp_home_dir --> off
ftpd_connect_db --> off
ftpd_use_fusefs --> off
ftpd_use_passive_mode --> off
httpd_enable_ftp_server --> off
tftp_anon_write --> off
tftp_use_cifs --> off
tftp_use_nfs --> off
[root@host2 test]# setsebool -P allow_ftpd_anon_write 1  //-P是永久保存生效
[root@host2 test]# setsebool -P allow_ftpd_full_access 1
[root@host2 test]# setsebool -P ftp_home_dir 1
[root@host2 test]# !get
getsebool -a | grep ftp
allow_ftpd_anon_write --> on
allow_ftpd_full_access --> on
allow_ftpd_use_cifs --> off
allow_ftpd_use_nfs --> off
ftp_home_dir --> on
ftpd_connect_db --> off
ftpd_use_fusefs --> off
ftpd_use_passive_mode --> off
httpd_enable_ftp_server --> off
tftp_anon_write --> off
tftp_use_cifs --> off
tftp_use_nfs --> off
[root@host2 ]# vim /etc/vsftpd/vsftpd.conf  //修改配置参数
anon_mkdir_write_enable=YES    //匿名可创建目录
anon_other_write_enable=YES    //匿名删除,重命名
anon_upload_enable=YES       //匿名用户是否可以上传文件
[root@host2 ]#service vsftpd restart
[root@host2 ftp]#cd /var/ftp
[root@host2 ftp]mkdir ftp_test
[root@host2 ftp]chown ftp:root ftp_test  //修改用户属主
Copy after login

on the linux server and then you can test it~~

Create a new file anonymously, rename and You can delete it

If an error of 550 occurs, it means there is a problem with the permission settings on the server. If it is 553, it means that there is a problem with the configuration file

Appendix: /etc/ vsftpd/vsftpd.conf configuration parameters

Key field meaning:

anonymous_enable=YES     #开启匿名共享
         local_enable=YES       #开启本地账户共享
         write_enable=YES       #本地账户是否可写
         anon_upload_enable=YES  #匿名用户是否可以上传文件
         anon_mkdir_write_enable=YES  #匿名可创建目录
         anon_other_write_enable=YES  #匿名删除,重命名
         chroot_local_user        #禁锢本地账户
         anon_root=/abc     #定义匿名用户根目录为/abc目录
         anon_umask=022     #定义匿名用户上传的掩码值
         listen_address=192.168.0.5 #定义监听地址为192.168.0.5
        listen_port=端口号
        listen_address=IP地址
        max_clients=最大并发连接数
        max_per_ip=同一IP地址的最大并发连接数
        anon_max_rate=匿名用户访问速度(字节/秒)
        local_max_rate=本地用户访问速度(字节/秒)
Copy after login

In the field userlist_enable=YES or NO //Whether to open the user_list file

When the field userlist_deny=NO user_list It is the whitelist

 /etc/vsftpd/ftpusers(黑名单)
/etc/vsftpd/user_list(黑/白名单)
Copy after login
The default vsftpd service:

Allows anonymous FTP access, can only download but not upload [/var/ftp/]

Allows local users FTP access, You can either download or upload [~username]

The above is the detailed content of About how to upload files to linux server via ftp on windows desktop. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Unable to log in to mysql as root Unable to log in to mysql as root Apr 08, 2025 pm 04:54 PM

The main reasons why you cannot log in to MySQL as root are permission problems, configuration file errors, password inconsistent, socket file problems, or firewall interception. The solution includes: check whether the bind-address parameter in the configuration file is configured correctly. Check whether the root user permissions have been modified or deleted and reset. Verify that the password is accurate, including case and special characters. Check socket file permission settings and paths. Check that the firewall blocks connections to the MySQL server.

Can I install mysql on Windows 7 Can I install mysql on Windows 7 Apr 08, 2025 pm 03:21 PM

Yes, MySQL can be installed on Windows 7, and although Microsoft has stopped supporting Windows 7, MySQL is still compatible with it. However, the following points should be noted during the installation process: Download the MySQL installer for Windows. Select the appropriate version of MySQL (community or enterprise). Select the appropriate installation directory and character set during the installation process. Set the root user password and keep it properly. Connect to the database for testing. Note the compatibility and security issues on Windows 7, and it is recommended to upgrade to a supported operating system.

How to solve mysql cannot be started How to solve mysql cannot be started Apr 08, 2025 pm 02:21 PM

There are many reasons why MySQL startup fails, and it can be diagnosed by checking the error log. Common causes include port conflicts (check port occupancy and modify configuration), permission issues (check service running user permissions), configuration file errors (check parameter settings), data directory corruption (restore data or rebuild table space), InnoDB table space issues (check ibdata1 files), plug-in loading failure (check error log). When solving problems, you should analyze them based on the error log, find the root cause of the problem, and develop the habit of backing up data regularly to prevent and solve problems.

Solutions to the errors reported by MySQL on a specific system version Solutions to the errors reported by MySQL on a specific system version Apr 08, 2025 am 11:54 AM

The solution to MySQL installation error is: 1. Carefully check the system environment to ensure that the MySQL dependency library requirements are met. Different operating systems and version requirements are different; 2. Carefully read the error message and take corresponding measures according to prompts (such as missing library files or insufficient permissions), such as installing dependencies or using sudo commands; 3. If necessary, try to install the source code and carefully check the compilation log, but this requires a certain amount of Linux knowledge and experience. The key to ultimately solving the problem is to carefully check the system environment and error information, and refer to the official documents.

How to pull the vertical reference line of PS How to pull the vertical reference line of PS Apr 06, 2025 pm 08:18 PM

Pull vertical guides in Photoshop: Enable ruler view (View > ruler). Hover the mouse over the vertical edge of the ruler, and then the cursor becomes a vertical line with double arrows and hold and drag the mouse to pull out the reference line. Click Delete by dragging the guide, or hovering it into a cross.

Can mysql run on android Can mysql run on android Apr 08, 2025 pm 05:03 PM

MySQL cannot run directly on Android, but it can be implemented indirectly by using the following methods: using the lightweight database SQLite, which is built on the Android system, does not require a separate server, and has a small resource usage, which is very suitable for mobile device applications. Remotely connect to the MySQL server and connect to the MySQL database on the remote server through the network for data reading and writing, but there are disadvantages such as strong network dependencies, security issues and server costs.

MySQL can't be installed after downloading MySQL can't be installed after downloading Apr 08, 2025 am 11:24 AM

The main reasons for MySQL installation failure are: 1. Permission issues, you need to run as an administrator or use the sudo command; 2. Dependencies are missing, and you need to install relevant development packages; 3. Port conflicts, you need to close the program that occupies port 3306 or modify the configuration file; 4. The installation package is corrupt, you need to download and verify the integrity; 5. The environment variable is incorrectly configured, and the environment variables must be correctly configured according to the operating system. Solve these problems and carefully check each step to successfully install MySQL.

How to solve the problem of missing dependencies when installing MySQL How to solve the problem of missing dependencies when installing MySQL Apr 08, 2025 pm 12:00 PM

MySQL installation failure is usually caused by the lack of dependencies. Solution: 1. Use system package manager (such as Linux apt, yum or dnf, Windows VisualC Redistributable) to install the missing dependency libraries, such as sudoaptinstalllibmysqlclient-dev; 2. Carefully check the error information and solve complex dependencies one by one; 3. Ensure that the package manager source is configured correctly and can access the network; 4. For Windows, download and install the necessary runtime libraries. Developing the habit of reading official documents and making good use of search engines can effectively solve problems.

See all articles