Python calls ftp.cwd (' xx/xx ') generates an error: resolution of the Failed to change Directoryd

Source: Internet
Author: User
Tags chmod


VSFTPD run in the ubuntu,ftp root directory for /home/ftpdir, the root directory has a folder get, program run FTP.CWD (' Get ') Error: Failed to change Directory


Workaround:

1. Sudo gedit/etc/vsftpd.conf

Add: Local_root=/home/ftpdir

The following three sentences get rid of #
Chroot_local_user=yes
Chroot_list_enable=yes
Chroot_list_file=/etc/vsftpd.chroot_list

Save

2.sudo gedit/etc/vsftpd.chroot_list

Increase the user name for FTP (one line for an FTP user name)

Save

3.sudo chmod 777/home/ftpdir

sudo chmod 777/home/ftpdir/get

4.sudo Service vsftpd Restart

FTP

FTP = FTP ()
ftp.set_debuglevel (2)
ftp.connect (' 192.168.0.118 ', @,)
ftp.login (' UFTDFDFP ', ' 123df456 ')
ftp.cwd (' Get ")
# do something
Ftp.quit ()


Related Article

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.