0

I need solution for something like this:

I am uploading file on server with a line:

ftp.storbinary(f'STOR a.json', file)

I have server vsftpd.

I need to change group during upload. I found something similar:

Change permissions via ftp in python

Author used line:

ftp.sendcmd('SITE CHMOD 644 ' + filename)

I need something like that:

 ftp.sendcmd('SITE CHOWN test_user:test_group' + filename)

How can i fix this?

Thanks for help.

luki
  • 197
  • 11
  • Only the superuser is normally allowed to change file ownership. And ordinary users are only allowed to change the group to one of their own secondary groups. FTP doesn't change these restrictions. – Barmar May 04 '22 at 20:20
  • should I add superuser to group test_user? – luki May 04 '22 at 20:27
  • 1
    How will that help? The FTP server isn't running as the superuser. – Barmar May 04 '22 at 20:28
  • And the superuser isn't subject to these restrictions, only ordinary users are. – Barmar May 04 '22 at 20:29
  • Ok. That means tha i should copy file, remove oryginal file and proceeed with copy. Regards – luki May 04 '22 at 20:41

0 Answers0