Configure FTP Directory

Posted on 2006-04-14
Last Modified: 2013-12-15
When I FTP to my SUSE 9.1, my default directory is \home\username.  How can I change my default directory to be /ftpdropbox which is directory off the root.

This is for outside users to send me files.


Question by:oceansupport
    LVL 15

    Accepted Solution

    The easiest way would be to remove your home directory and replace it with a symlink to /ftpdropbox:

    rm -rf /home/username
    ln -s /ftpdropbox /home/username

    make sure /ftpdropbox is accessible to the user in question. NOTE: this will work with vsftp - if you use any other FTP server it may depend on the server parameters whether it follows symlinks or not.

    Another alternative is to change user's home directory completely, and you can do that by either editing /etc/passwd  or using

    usermod -d /ftpdropbox username
    LVL 3

    Assisted Solution

    go to /etc/passwd and change home directory of the user you are logging to the FTP server. The link thing mentioned before will not work with JAIL!
    An example from /etc/passwd file

    the /export/home/petrus is the HOME directory of petrus user and this is the directory you are changed to while you login to your FTP server.
    don't forget to change privileges or owner chown youruser:users /destination/directory (optional - only if you will not be able to write to the dir)
    LVL 15

    Expert Comment

    >>The link thing mentioned before will not work with JAIL!<<

    It works perfectly fine with my ~20 users right now. Would you care to explain why wouldn't it work?

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
    SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
    Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
    Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

    779 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

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now