Gentoo Archives: gentoo-user

From: Mick <michaelkintzios@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] vsftpd anonymous upload illegal PORT command
Date: Thu, 03 Aug 2017 19:26:24
Message-Id: 2657654.UTlHZM9tmn@dell_xps
In Reply to: Re: [gentoo-user] vsftpd anonymous upload illegal PORT command by Walter Dnes
1 On Thursday 03 Aug 2017 15:02:51 Walter Dnes wrote:
2 > On Thu, Aug 03, 2017 at 07:50:32AM -0700, Jeriko One wrote
3 >
4 > > Are you able to upload files from other machines than this particular
5 > > VM? I don't have any problems uploading using your config.
6 >
7 > It fails uploading a test file from the linux machine hosting the VM.
8 >
9 > > Who owns /home/ftp? I think by default vsftpd will change the owner
10 > > to root which would cause problems.
11 >
12 > I get more verbose error messages with the linux ftp client. On the h
13 >
14 > [i3][root][/dev/shm] ftp 192.168.123.251
15 > Connected to 192.168.123.251 (192.168.123.251).
16 > 220 (vsFTPd 3.0.2)
17 > Name (192.168.123.251:waltdnes): anonymous
18 > 530 Please login with USER and PASS.
19 > SSL not available
20 > 331 Please specify the password.
21 > Password:
22 > 230 Login successful.
23 > Remote system type is UNIX.
24 > Using binary mode to transfer files.
25 > ftp> put hello.txt
26 > local: hello.txt remote: hello.txt
27 > 200 PORT command successful. Consider using PASV.
28 > 553 Could not create file.
29 > ftp> bye
30 > 221 Goodbye.
31 >
32 > This was with the upload dir on 192.168.123.251 with permissions 555
33 > [d531][root][~] ll /home/ftp/
34 > total 8
35 > dr-xr-xr-x 2 ftp ftp 4096 Aug 3 06:41 .
36 > drwxr-xr-x 6 root root 4096 Aug 3 06:41 ..
37
38 It could not create file because your ftp user:group do not have write
39 permission.
40
41
42 > If I change permissions on /home/ftp to 666, I get...
43 >
44 > [i3][root][/dev/shm] ftp 192.168.123.251
45 > Connected to 192.168.123.251 (192.168.123.251).
46 > 220 (vsFTPd 3.0.2)
47 > Name (192.168.123.251:waltdnes): anonymous
48 > 530 Please login with USER and PASS.
49 > SSL not available
50 > 331 Please specify the password.
51 > Password:
52 > 500 OOPS: vsftpd: refusing to run with writable root inside chroot()
53 > Login failed.
54 > ftp> bye
55 >
56 > How is this supposed to work anyways? Can't write to upload dir if
57 > it's not writable, but vsftpd refuses to run if the upload dir is
58 > writeable. Help.
59
60 According to the man page here:
61
62 https://security.appspot.com/vsftpd/vsftpd_conf.html
63
64 " ... the anonymous ftp user must have write permission on desired upload
65 locations."
66
67 You may want to try setting
68
69 file_open_mode=0777
70
71 in your vsftpd.conf and check ftp user or group have write permissions within
72 the /home/ftp/ directory.
73
74 --
75 Regards,
76 Mick

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] vsftpd anonymous upload illegal PORT command Bruce Schultz <brulzki@×××××.com>