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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Network Interface Card (NIC) bonding, also known as link aggregation, NIC teaming and trunking, is an important concept to understand and implement in any environment where high availability is of concern. Using this feature, a server administrator …
If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month9 days, 17 hours left to enroll

762 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