LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 03-17-2012, 01:01 AM   #1
SarahGurung
Member
 
Registered: Jul 2011
Posts: 310

Rep: Reputation: Disabled
Ftp Client error in centos and where to change the umask for ftp users?


Well inorder to give read, write and execute permission to the ftp users who are hosting their websites with us where whould we change their permission?

We are using vsftpd for ftp and in that configuration file the umask is set to 022?is that where i should change to 012 so that they can upload it?

Because when they tried uploading their website through ftp client it gave the following error:

Code:
Transfer channel cannot be opened. Reason: A connection attempt failed because the connected party 
did not properly respond after a long period of time.or established connection failed because connected 
host has failed to respond.

Error: Could not retrieve directory listing
But the problem is they can login and can even telnet our ftp server and ping it..
And we as the owner can upload the the files though so thought the issue was with the umask.

And in our iptables both port 20 and 21 is open but wen i see the listening ports,port 20 is not there..

Last edited by SarahGurung; 03-17-2012 at 01:04 AM.
 
Old 03-17-2012, 05:46 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,956

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Hi,
Quote:
Well inorder to give read, write and execute permission to the ftp users who are hosting their websites with us where whould we change their permission?

We are using vsftpd for ftp and in that configuration file the umask is set to 022?is that where i should change to 012 so that they can upload it?
Why do you want to give execute permissions to your users? Using umask 022 (meaning 755 file permissions), is the right thing to do. Note that the files created on the ftp server are loosing their execute rights for security reasons regardless the umask.
Anyway if you're sure that you want the execute rights on files transferred, you can let umask as is and add:
Code:
file_open_mode=0755
Quote:
Because when they tried uploading their website through ftp client it gave the following error:

Transfer channel cannot be opened. Reason: A connection attempt failed because the connected party
did not properly respond after a long period of time.or established connection failed because connected
host has failed to respond.

Error: Could not retrieve directory listing
I guess your firewall does not allow active ftp, so you have to configure vsftpd for passive mode and do the same for your ftp client.

Quote:
And in our iptables both port 20 and 21 is open but wen i see the listening ports,port 20 is not there..
Port 20 is not listening. It opens only for the data transfer.
 
Old 03-18-2012, 11:07 PM   #3
SarahGurung
Member
 
Registered: Jul 2011
Posts: 310

Original Poster
Rep: Reputation: Disabled
Well can you please tell me what should i do and how to enable passive ftp in vsftpd and also in ftp client?
 
Old 03-19-2012, 02:16 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,956

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Hi,

Use the following in vsftpd.conf
Code:
pasv_enable=YES
pasv_max_port=20000
pasv_min_port=21000
port_enable=YES
Of course you need to open ports 20000-21000 in your firewall.

Regarding clients, you should take a look at their configuration options. Some of them can fallback from active to passive.

Regards
 
Old 03-19-2012, 05:56 AM   #5
SarahGurung
Member
 
Registered: Jul 2011
Posts: 310

Original Poster
Rep: Reputation: Disabled
well how do i add those range of ports in the firewall?

And by firewall do you mean iptables?

Well i tried adding them in iptables but it wasn't added at the end,maybe the syntax was incorrect..

So can you please tell how should i go about it..
 
Old 03-19-2012, 06:09 AM   #6
raj47
Member
 
Registered: Jan 2011
Posts: 47

Rep: Reputation: 2
Hi,

iptables -I INPUT -p tcp --dport 21 -j ACCEPT


This is will open port 21 for public else you have to take a look at your logs /var/log

Thanks
Puspharaj
 
Old 03-19-2012, 06:46 AM   #7
SarahGurung
Member
 
Registered: Jul 2011
Posts: 310

Original Poster
Rep: Reputation: Disabled
ya i know about that and it has been already added,..

I'm asking about the passive ports....how do i add that pasv_min_port and pasv-max_port which is actually a range in the firewall or the iptables?
 
Old 03-19-2012, 07:55 AM   #8
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,956

Rep: Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341Reputation: 1341
Quote:
Originally Posted by SarahGurung View Post
ya i know about that and it has been already added,..

I'm asking about the passive ports....how do i add that pasv_min_port and pasv-max_port which is actually a range in the firewall or the iptables?
Take a look here
 
Old 03-19-2012, 08:35 PM   #9
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,311

Rep: Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040Reputation: 2040
You may find this informative for background understanding http://slacksite.com/other/ftp.html
 
Old 03-20-2012, 05:19 AM   #10
SarahGurung
Member
 
Registered: Jul 2011
Posts: 310

Original Poster
Rep: Reputation: Disabled
Wow thank you two of you....i went through the link given and did as told and it worked now, i mean the client uploaded the web.

But he said now he is getting the same error in the database server... Now i don't have any clue as to what port is required for that.... Can anyone help me again?
 
Old 03-20-2012, 05:54 AM   #11
SarahGurung
Member
 
Registered: Jul 2011
Posts: 310

Original Poster
Rep: Reputation: Disabled
thank you all...it worked now..
 
  


Reply


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to change default /var/ftp/pub in ftp(vsftpd) mohd anas Linux - Networking 3 07-08-2011 03:14 PM
file transfer program in c using FTP client and FTP server renuaseri Linux - Newbie 2 01-29-2011 06:49 AM
FTP Server and edquota to make ftp users deepak.inss Linux - Newbie 2 01-08-2010 07:24 AM
FTP Server Up and running... how do I hide ftp users from local login screen? joe1031 Mandriva 2 03-18-2005 05:24 PM
how can I restrict ftp users listing files from a pure-ftp server adrianmak Linux - Networking 2 12-31-2002 09:23 AM


All times are GMT -5. The time now is 07:45 AM.

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