Home  >  Article  >  Operation and Maintenance  >  How to configure vsftp remote connection in linux

How to configure vsftp remote connection in linux

王林
王林forward
2023-05-19 22:13:211705browse

You can see from the code below that the Linux operating system comes with vsftp. The command to start is service vsftpd start, and the command to check the status of the ftp service is service vsftpd status.

[root@localhost ~]# rpm -qa | grep ftp
report-config-ftp-0.18-9.el6.i686
report-plugin-ftp-0.18-9.el6.i686
gvfs-obexftp-1.4.3-12.el6.i686
vsftpd-2.2.2-6.el6_0.1.i686

According to logic Now that the ftp service has started, I should be able to upload files, so I used xshell4 to connect to the system, but was told that it could not be connected. I carefully reviewed the previous operation process, and searched for blogs on the Internet, and found that xshell The service used for remote connection is ssh, so I started the ssh service again. Because I didn’t know what the xshell tool was for, I made such a big joke. It was really ridiculous. But after the ssh service was started, I found out Only the root user can log in remotely, and other users cannot log in. So, continue Baidu google, and see that you need to modify /etc/ssh/sshd_config. There are allowusers xxx xxx and allowgroups xxx xxx commands. You can add user names and groups to it. User xxx can log in remotely, but it doesn't seem to work. This problem is still unresolved. Let's explore slowly. Now that we have said this, there are many posts on the Internet about root remote login being unsafe. I am also the same. I think it is best not to log in remotely as root, so the corresponding method is to modify the options in /etc/ssh/sshd_config. There is permitrootlogin yes|no, and setting it to no will not prevent ordinary users from suing to the root user. This is also a question that will be followed up later, and I will add this question to this article later.

Now the root user can use xshell to remotely log in to the Linux system. Click the new file transfer icon on the menu to use the ftp command. It does not mean that you must use xshell, but our company uses this software. , so I just made do with it. If I don’t need to log in remotely and upload directly using ftp, then downloading ftp may be less troublesome than what I am doing now, but you have to try it yourself, hehe

Upload the jdk and tomcat compressed packages downloaded by windows that are suitable for linux systems, and then decompress them to the appropriate directory. The command is tar -zxvf jdk-xxx-xx. After decompression, configure the environment variables. My environment The variable file is /etc/profile. Different system files will be different. Add the following lines to this file and be sure not to make any mistakes. After an error is made, a file not found error will be reported when starting tomcat. This is what I did. The mistakes were all trivial mistakes that were not worth mentioning, and they wasted time, hey. . .

export java_home=/home/java/jdk1.8.0_40
export jre_home=${java_home}/jre
export classpath=.:${java_home}/lib:${jre_home}
export path=${java_home}/bin:$path

Then restart linux, test java -version, javac -version to see if these messages appear

[root@localhost ~]# java -version
java version "1.8.0_40"
java(tm) se runtime environment (build 1.8.0_40-b26)
java hotspot(tm) client vm (build 25.40-b25, mixed mode)
[root@localhost ~]# javac -version
javac 1.8.0_40

If there are these messages, it means that the installation of jdk is successful, followed by the installation of tomcat, Unzip it first as above, then configure the environment variables and add the following content:

export catalina_home=/home/java/apache-tomcat-8.0.21
export classpath=.:${java_home}/lib:${jre_home}:${catalina_home}/lib

Then we can upload the project we wrote to tomcat webapps using the method of uploading jdk before, and then start tomcat

You can dynamically view the output of catalina.out, the command is tail -f catalina.out

The above is the detailed content of How to configure vsftp remote connection in linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:yisu.com. If there is any infringement, please contact admin@php.cn delete