LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-02-2007, 04:41 AM   #1
Hammad101
Member
 
Registered: Dec 2005
Posts: 72

Rep: Reputation: 15
FTP Permissions


Hi,

I recently rented an Ded. Server. (Linux > Debian)

I need some help / info on FTP User Permissions.

How can I setup an FTP User in such a way that he only is able to look at the Home directory.

http://img45.imageshack.us/img45/6271/ftpyu5.png
This link above is the ftp directory in Smartftp (server names & ip blacked)

I do not want them to see the directories in Red box
but only the blue ones in which they will upload / download files.
also the files shall be downloadable via http to others..

How can that be done?

P.S: Please let me know the full commands as i'm new so good at linux.

Thank You Very Much.
 
Old 10-02-2007, 11:10 AM   #2
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 448

Rep: Reputation: 38
It's a matter of adjusting the configuration files and then restarting the daemon (FTP server). Normally, you'll find any such information in the man pages ("manual pages") of the FTP server program you're using. Without knowing exactly what you're using it's not possible to tell you exactly what to do anyway. I could tell you for ProFTPd, but I don't know if it's right for you.

M.
 
Old 10-03-2007, 01:55 AM   #3
Hammad101
Member
 
Registered: Dec 2005
Posts: 72

Original Poster
Rep: Reputation: 15
I don't have much of linux knowledge
Can you please tel how can i find out that
what ftp i am using?

or if this is any helpful

Quote:
Linux version 2.6.8-2-686-smp (horms@tabatha.lab.ultramonkey.org) (gcc version 3.3.5 (Debian 1:3.3.5-12)) #1 SMP Thu May 19 17:27:55 JST 2005
 
Old 10-03-2007, 03:08 AM   #4
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 448

Rep: Reputation: 38
This is "uname -a" - it's clear that you're using an old Debian version, no more, no less; it's the last (not the latest) stable (3.1 - dubbed "Sarge"), judging from the kernel (I could be wrong).

Suggestion: try (on a root terminal):
Code:
# dpkg -l | grep ftp
and put the results here (any lines starting with "ii" are interesting).
 
Old 10-03-2007, 03:54 AM   #5
Hammad101
Member
 
Registered: Dec 2005
Posts: 72

Original Poster
Rep: Reputation: 15
ii ftp 0.17-12 The FTP client.
ii psa-ftputil 8.2.0-debian3. Plesk-packaged version of ftputil module
ii psa-proftpd 1.3.0-debian3. ProFTPD -- Professional FTP Server.
ii psa-proftpd-in 1.3.0-debian3. ProFTPD -- Setup for inetd operation.
 
Old 10-03-2007, 04:41 AM   #6
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 448

Rep: Reputation: 38
Okay, now it's easy
I'll presume you're on a root cli.
  • Locate /etc/proftpd.conf - it will be there if the system hasn't been setup in a customized way; if not, do
    Code:
    # whereis proftpd
    to find it.
  • Do
    Code:
    # cat /etc/proftpd.conf | grep DefaultRoot
    If there's nothing, replace "DefaultRoot" with "defaultroot" to make sure. If there is no such line, you'll have to add it (at the end of the file is fine).
  • Use your favourite text editor to either change the line you found to
    Code:
    DefaultRoot ~
    or add that line to the conf file. This'll restrict FTP users who are also system users to their home directory. To adjust the directory your users should be confined to to something else, simply enter the full path instead of "~".
 
Old 10-03-2007, 11:56 AM   #7
Hammad101
Member
 
Registered: Dec 2005
Posts: 72

Original Poster
Rep: Reputation: 15
Hi,

This is what i get

Quote:
0.0.0.0:~# whereis proftpd
proftpd: /usr/sbin/proftpd /etc/proftpd.include /etc/proftpd.conf /usr/share/man/man8/proftpd.8.gz

0.0.0.0:~# cat /etc/proftpd.conf | grep DefaultRoot
DefaultRoot ~ psacln
The user group i want to give apply permissions on is " Chawal "
 
Old 10-04-2007, 08:16 AM   #8
Hammad101
Member
 
Registered: Dec 2005
Posts: 72

Original Poster
Rep: Reputation: 15
anyone?

can you please explain
also i'm using SSH how would i be editing ....?
 
Old 10-04-2007, 11:36 AM   #9
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 448

Rep: Reputation: 38
DefaultRoot's already set to each users' home directories for the group "psacln"; you can either change the group right there or scan (i.e. read) the conf file to find the place where to set the group that can use the server! But be careful and take care to look for the right instructions/settings.

And for SSH, you'll have to have sshd installed and running, which has nothing(!) to do with proFTPd and will use a different configuration file. However, on login (if configured that way), each user will be at least able to read and control the stuff in his/her home directory. It's a nice thing to offer to users, but beware of security hazards... In short: Confine your users to their home directories, and be careful who you offer which rights...

M.

Last edited by MoonMind; 10-05-2007 at 10:53 AM.
 
Old 10-05-2007, 03:12 AM   #10
hlimaiem
LQ Newbie
 
Registered: Oct 2007
Posts: 5

Rep: Reputation: 0
i have the same problem and when i use the command before

i have those line:
ii dpkg-ftp 1.6.10 Ftp method for dselect.
ii ftp 0.17-12 The FTP client.
ii ncftp2 2.4.3-14 A user-friendly and well-featured FTP client
rc proftpd-common 1.2.10-15sarge Versatile, virtual-hosting FTP daemon
rc proftpd-mysql 1.2.10-15sarge Versatile, virtual-hosting FTP daemon (with
ii pure-ftpd 1.0.19-4 Pure-FTPd FTP server
ii pure-ftpd-comm 1.0.19-4 Pure-FTPd FTP server (Common Files)

how can i resolve this problem (i can't connect to the ftp server).
 
Old 10-05-2007, 09:58 AM   #11
Hammad101
Member
 
Registered: Dec 2005
Posts: 72

Original Poster
Rep: Reputation: 15
Quote:
MoonMind

DefaultRoot's already set to each users' home directories for the group "psacln"; you can either change the group right there or scan (i.e. read) the conf file to find the place where to set the group that can use the server! But be careful and take care to look for the right instructions/settings.

And for SSH, you'll have to have sshd installed and running, which has nothing(!) to do with proFTPd and will use a different configuration file. However, on login (if configured that way), each user will be at least able to read and control the stuff in his/her home directory. It's a nice thing to offer to users, but beware of security hazards... In short: Confine your users to their home directories, and be careful who you offer what rights...

M.
Thank you so much!!
 
Old 10-05-2007, 10:52 AM   #12
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 448

Rep: Reputation: 38
Hammad101: my pleasure

hlimaem: yours is probably pureFTPd (for proFTPd, the actual server package is missing, but may have been there at some time in the past, judging from the support packages' left-overs' presence); since I've never used it, I'm not proficient in configuring it. But a good start would be to use
Code:
$ man pure-ftpd
At the end of each man page, you'll find a list of correspondig files; I'd bet on something with ".conf" at the end lying around somewhere (my best guess is /etc). Read the documentation carefully, hope for a sample (there normally is one!). Also helpful:
Code:
$ which pure-ftpd
You can do all that without being root - a good thing to take a look first before meddling with configuration! When you're ready to start editing the configuration file(s), switch to root (or use "sudo", preferably), than do something like
Code:
# gedit pure-ftpd.conf
(supply your favourite editor and your actual configuration file's correct name here) and start do your thing.

M.

Last edited by MoonMind; 10-05-2007 at 10:56 AM.
 
Old 10-06-2007, 03:39 AM   #13
hlimaiem
LQ Newbie
 
Registered: Oct 2007
Posts: 5

Rep: Reputation: 0
Sorry but i didn't understand what you asking me to do for getting solution to my problem.
The problem i have, that when i try to connect by ftp server using for example (filezilla or smartftp) i have those message:
Status: Connecting to My_IP:21...
Status: Connection established, waiting for welcome message...
Error: Could not connect to server

Also when i try this command to test the server in SSH mode
/usr/sbin/pure-ftpd -S 127.0.0.1,21 -c 30 -C 1 -l puredb:/etc/pureftpd.pdb -x -E -j -R
I have this message:
Unable to start a standalone server: Address already in use

I've also changed proftpd.conf with "ServerType standalone" the same messages appears.
When i'm trying this command "dpkg -l | grep ftp"

ii dpkg-ftp 1.6.10 Ftp method for dselect.
ii ftp 0.17-12 The FTP client.
ii ncftp2 2.4.3-14 A user-friendly and well-featured FTP client
rc proftpd-common 1.2.10-15sarge Versatile, virtual-hosting FTP daemon
rc proftpd-mysql 1.2.10-15sarge Versatile, virtual-hosting FTP daemon (with
ii pure-ftpd 1.0.19-4 Pure-FTPd FTP server
ii pure-ftpd-comm 1.0.19-4 Pure-FTPd FTP server (Common Files)

Did i have more than one configuration for FTP connection.
I don't know what to do to resolve this problem.
Can i remove all installation of FTP configurations in my server and can you give all the exacts steps to configure FTP.
Thank you for your precious help.
 
Old 10-08-2007, 07:56 AM   #14
MoonMind
Member
 
Registered: May 2005
Location: Switzerland
Distribution: Ubuntu
Posts: 448

Rep: Reputation: 38
I think you're not running proFTPd, so it's not really probable that changing the /etc/proftpd.conf file will help in any way...

The messages tell you that an FTP daemon (your server) is already started (and it appears to be pure-ftpd - that's what the second error message is saying when you're trying the /usr/bin/pure-ftpd line), but there's probably one of two things happening:

1. Did you try to connect to 127.0.0.1:21 (I ask because of "My_IP:21" in your last post)? If you were trying your own external IP from inside your WAN connection, you'll not be able to connect, receiving exactly the error message you report. "localhost", OTOH, should work (which is 127.0.0.1 - but you know that, obviously) - if there's a running daemon to connect to, of course. As I said, the error message indicates this should be the case

2. Maybe a firewall (software or hardware - probably the first, though, because that could even imped local connections) blocks port 21. If trying from the outside, you'll have to redirect FTP traffic to the server in question before it can work. I can't tell you exactly how to do this, though, because it's probably done by your router or cable modem.

I'm not sure if I'm on the right track here, but I want to make sure that the basic setup is correct. I doupt that there are two different daemons running; you could check, though:
Code:
$ sudo ps axu | grep ftp
- normally, the daemon in charge says something like "accepting connections". You'll also want to locate your pure-ftpd config files just in case they need some work.

M.

Last edited by MoonMind; 10-08-2007 at 07:58 AM.
 
Old 10-16-2007, 07:57 AM   #15
Hammad101
Member
 
Registered: Dec 2005
Posts: 72

Original Poster
Rep: Reputation: 15
Hi,

Is there anyway i can do this

Quote:
0.0.0.0:~# cat /etc/proftpd.conf | grep DefaultRoot
DefaultRoot ~ psacln
for a single user or something ??
 
  


Reply



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
FTP permissions...HELP!!! Crog Linux - Newbie 4 05-28-2006 01:59 AM
Permissions and FTP Josh100 Linux - Newbie 8 05-09-2006 10:12 AM
FTP Permissions varunbihani Linux - General 2 03-24-2005 09:34 AM
Permissions on FTP ntloser Linux - Security 1 12-28-2003 12:10 PM
FTP Permissions Wynd Linux - General 4 11-04-2003 08:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration