# vsftpd doesn't list current working directory



## sferruzza (Oct 26, 2010)

I just installed vsftpd on a Solaris 10 machine and am having a small issue. It works completely fine with the exception of not showing what directory you are in. Chroot is setup so I was hoping that it would show the user's current working directory instead of giving the following:

bash-3.00# ftp localhost
Connected to localhost.
220 "Welcome to the FTP Server!"
Name (localhost:sferruzz): urgent4
331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> pwd
257 "/"
ftp> bye


The directory should be /urgent4.

Does anyone have any ideas how to get it to appear?

Thanks,
Steve

Conf:
anonymous_enable=NO
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=NO
xferlog_file=/var/log/xferlog
idle_session_timeout=600
chroot_local_user=YES
listen=YES


----------



## lotuseclat79 (Sep 12, 2003)

Hi sferruzza,

If you are in the '/' directory upon an FTP login, then you must (after the pwd), do an "ls" command, followed by a "cd" command to get to the /urgent4 or /home/urgent4 directory. This probably has to do with the vsftp configuration file - look for a /etc/vsftp.conf file, and if there edit it's setup the way you want it, i.e. to access an account's login directory if that is even possible at all. Look for the man page on vsftp, i.e. issue the command: man vsftp.

Did you try the ? command at the >ftp prompt to find out what command it supports.

-- Tom


----------



## sferruzza (Oct 26, 2010)

When I login it is in the /urgent4 directory but it is only showing / directory. I tested this by doing a mkdir test. When I go to the directory on the ftp machine in a terminal session the test directory is in the /urgent4 directory.

Is there some setting which makes your current directory appear??

ftp> user urgent4
331 Please specify the password.
Password:
230 Login successful.
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
226 Directory send OK.
ftp> pwd
257 "/"
ftp> mkdir test
257 "/test" created
ftp> ls
200 PORT command successful. Consider using PASV.
150 Here comes the directory listing.
test
226 Directory send OK.
6 bytes received in 0.077 seconds (0.08 Kbytes/s)
ftp> pwd
257 "/"
ftp> bye
221 Goodbye.
# pwd
/ftp2/urgent4
# ls -l
total 2
drwxr-xr-x 2 urgent4 ftpguests 512 Oct 26 20:27 test
#


----------



## lotuseclat79 (Sep 12, 2003)

Hi sferruzza,

Welcome to TSG!

After login, if you know it is in the /urgent4 directory, then what is the problem? If you know where you are and the signpost says something different, then "you know where you are".

Using the ? command (if you did not already) lists the available ftp> commands that are possible, i.e. do:
ftp> ?

The website for vsftpd is Here, and the man page for vsftpd is Here.

Note: According to the man page: 


> ftp_username
> This is the name of the user we use for handling anonymous FTP. The home directory of this user is the root of the anonymous FTP area.


What you are experiencing is the default behavior of vsftpd. Look for more documentation on changing the /etc/vsftpd.conf file to get the behavior you want, or send email to the developer for specific help in expressing your need.

-- Tom


----------



## sferruzza (Oct 26, 2010)

The "signpost" as you call it that tells you directory you are in doesn't matter to me as the systems adminstrator. We are moving from an old wuftp client which does show what directory you are in and NOT showing it might confuse some of the hundreds of different account logins used on the ftp server.

When I poked around the web and saw samples of vsftpd all of them do give you the correct signpost to show what directory you are actually in when you log in. So it seems that some minor tweak needs to be done to make it appear correctly.


----------



## sferruzza (Oct 26, 2010)

Further on this one.... if I turn off chroot in any form then I can see my pwd correctly when logging in as follows:

ftp> pwd
257 "/ftp2/urgent4"
ftp>


----------



## lotuseclat79 (Sep 12, 2003)

Hi sferruzza,

Thanks for the update!

--- Tom


----------

