configuring ftp to access root directory

Posted on 2003-03-19
Medium Priority
Last Modified: 2006-11-17

i hav machine running on redhat 7.3 with ftp installed on it... whenever i access it thru ftp it asks for username and password and after successful login it defaults to the home directory of that user... if i try to go 1 directory up with *cd ..* command it replys sayin no such file or directory... i want to access thru ftp 1 directory which is in some other mount point... so i created a softlink in the home directory of the user and try to access this directory but it returns me the same error but if i try to change the directory thru telnet then it works fine...

eg. my login username is username and home directory is /home/username then after login and give the pwd command then it says "/"

ftp> pwd
257 "/" is current directory.

even though its /home/username
i created a softlink in /home/username as
ln -s /usr/otherdir my_link
which creates link successfully and works fine with telnet but thru ftp it returns followin error

ftp> cd my_link
550 my_link: No such file or directory.

any solution or workaroun to access directories other than home directory of the loggin-in user???

thanx in anticipation
Question by:olsworld

Accepted Solution

Nicalya earned 150 total points
ID: 8165126
One way to do such thing, is ftp using the root-user (delete the "root" entry in /etc/ftpusers).

A normal user is restricted to a simulated chroot environment.  Have you gone thru your ftp-config?  
Normally there should be an option to disable browse-restriction
LVL 17

Expert Comment

ID: 8165195
Hi olsworld.

Although it can be done, it is usually not a very safe thing to do.

What I would suggest is for you to use sftp instead.

The commands are as follow:

sftp servername

You can setup most ftp clients to connect via ssh protocol, and it will have the addedd advantage of automagically locking all yuour users into their home folders, preventing them from browsing around the system.
LVL 20

Expert Comment

ID: 8165549
Good suggestion by psimation.

One way to do the less good thing ("break the chroot jail", so to speak) is by remounting the directoy you are interested in inside the jail (as you've seen, symlinks wont hack it):

mount --bind /some/where inside_jail

would mount the directory /some/where on the mount point (directory) "inside_jail", pretty much as your sym-link attempt.

-- Glenn

Author Comment

ID: 8166751
i enable "guestuser *" in "ftpaccess" to allow users to access root directory thru ftp... it may not be safe but its samll private network and this works fine for me...

thanks for your support and information

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month7 days, 21 hours left to enroll

616 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question