Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 07-08-2005, 08:38 AM   #1
Registered: Aug 2004
Location: Bangalore
Posts: 64

Rep: Reputation: 16
ftp changes file permissions!

I have a Red Hat 8 installed machine. Very often I used to transfer a bin to another machine in the same network using ftp. I will login as "root" to that machine. The issue is after the file transfer the bin file's executable permission is gone. Every time I have to do
chmod +x <bin-file> to make it executable. Why the executable permission is not retained? Can anyone explain me? Thanks.
Old 07-08-2005, 12:21 PM   #2
Senior Member
Registered: Dec 2003
Location: Paris
Distribution: Slackware forever.
Posts: 2,515

Rep: Reputation: 99
What is your ftp server? If it's not vstfp, then install it, and edit /etc/vsftpd.conf. All is explained here.
Old 07-13-2005, 07:34 AM   #3
Registered: Aug 2004
Location: Bangalore
Posts: 64

Original Poster
Rep: Reputation: 16
I have vsftpd-1.1.3-8 installed in my machine.

After some study I found out that file_open_mode numeric option does the default permission setting for uploaded files. I added this option inside my vsftpd.conf file. The man vsftpd.conf page says....

The permissions with which uploaded files are created. Umasks are applied on top of this value. You may wish to change to 0777 if you want uploaded files to be executable.

Default: 0666

I edited the vsftpd.conf file, added this option with file_open_mode=0777 and restarted the vsftpd service. I have a file with permission 0700 in my home directory.

[seran@seran seran]$ ls -tl
-rwx------ 1 seran ico 417 Jul 13 14:59

Then I did a file transfer, the umask value in the destination machine was 0022.

[root@pluto root]# umask

But the file permissions were......

[root@pluto root]# ls -tl
-rw-r--r-- 1 root root 417 Jul 13 18:06

So default file permission 0666 was applied, and after umask it became 0644. The option file_open_mode=0777 didnt had any affect on the file transfer.

Did I missed anything here?


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
setting permissions on a file after uploading via FTP dgsr2002 Linux - Newbie 4 10-21-2004 07:15 PM
Permissions wrong on FTP file upload jwest44 Linux - Newbie 3 06-23-2004 10:15 AM
File/Folder Permissions with FTP scottpioso Linux - Security 8 03-12-2004 02:19 PM
locking a usage policy file/ftp file permissions gbow Linux - Newbie 0 02-16-2004 05:35 AM
An odd case of FTP file permissions paradoxlight Linux - Security 6 04-20-2003 09:40 PM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:27 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration