1

I use netstat -plnt check the vsftpd deamon, it is listening the IPv6(tcp6) address, so I use the FileZilla can not connect the VM.

[root@localhost src]# netstat -plnt 
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 192.168.122.1:53        0.0.0.0:*               LISTEN      2092/dnsmasq        
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1537/sshd           
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1540/cupsd          
tcp        0      0 127.0.0.1:25            0.0.0.0:*               LISTEN      1969/master         
tcp6       0      0 :::21                   :::*                    LISTEN      24464/vsftpd        
tcp6       0      0 :::22                   :::*                    LISTEN      1537/sshd           
tcp6       0      0 ::1:631                 :::*                    LISTEN      1540/cupsd          
tcp6       0      0 ::1:25                  :::*                    LISTEN      1969/master 

So, how can I change the vsftpd listen port to the IPv4 (tcp)?

2

You should change the vsftpd.conf which should be located in /etc/vsftpd.conf and update the IPv6 option to NO and Listen to Yes

listen Yes
listen_ipv6 NO

More info in vsftpd manpage

NAME
       vsftpd.conf - config file for vsftpd

DESCRIPTION
       vsftpd.conf  may  be  used  to  control  various  aspects  of  vsftpd's
       behaviour. By default, vsftpd looks  for  this  file  at  the  location
       /etc/vsftpd.conf.   However,  you  may  override  this  by specifying a
       command line argument to vsftpd.  The  command  line  argument  is  the
       pathname of the configuration file for vsftpd. This behaviour is useful
       because you may wish to use an advanced inetd such as xinetd to  launch
       vsftpd with different configuration files on a per virtual host basis.

listen_ipv6

      Like  the listen parameter, except vsftpd will listen on an IPv6
      socket instead of an IPv4 one. This  parameter  and  the  listen
      parameter are mutually exclusive.

      Default: NO  

listen

If enabled, vsftpd will run in standalone mode. This means  that
vsftpd  must not be run from an inetd of some kind. Instead, the
vsftpd executable is run once directly. vsftpd itself will  then
take care of listening for and handling incoming connections.

              Default: NO
  • Make sure you have set listen=YES to enable ipv4 otherwise vsftpd will not be able to create IPv4 socket. – Sourav Jun 18 '17 at 6:38
  • @Yaron I changed the configuration file(vsftpd.conf), so I should restart the vsftpd? – three-blocks Jun 18 '17 at 9:10
  • @three-blocks - Yes. You should restart the vsftpd – Yaron Jun 18 '17 at 9:57
  • @Yaron I can not restart it, see there:unix.stackexchange.com/questions/371764/… – three-blocks Jun 18 '17 at 10:43
  • @three-blocks - the "Listen=Yes" is required if you are running in standalone mode. In your case, when you aren't running in stand-alone mode, please change it back to "listen=No". i.e. the only change will be in listen_ipv6 parameter – Yaron Jun 18 '17 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.