# vsftpd not showing directories with sshfs mounts

## sege

Hey there,

I just set up a vsftpd on my server using virtual users.

I figured out that the standard ftp root is /home/ftp. I can upload and download to there via gftp.

Now if I ssh to this server (as root on the server), create a new directory in /home/ftp, chown this new directory to ftp:ftp and after that mount a directory from a different server via sshfs to this new directory, the directory disappears in the listing of gftp.

If I try to access it manually by typing in the name, I get 

550 Failed to change directory.

Can somebody help me with this ?

----------

## Hu

What is the output of ls -la /home/ftp/?

----------

## sege

```
fuckup ftp # ls -la

total 16

drwxr-xr-x 4 ftp  ftp  4096 Mar 16 13:13 .

drwxr-xr-x 3 root root 4096 Mar 16 12:59 ..

drwx------ 2 ftp  ftp  4096 Mar 16 13:13 Hallo

-rw-r--r-- 1 root root    0 Mar 16 13:02 asdf

drwxr-xr-x 1 ftp  ftp  4096 Mar 16 17:11 hacktor

fuckup ftp # umount hacktor/

fuckup ftp # ls -la

total 16

drwxr-xr-x 4 ftp  ftp  4096 Mar 16 13:13 .

drwxr-xr-x 3 root root 4096 Mar 16 12:59 ..

drwx------ 2 ftp  ftp  4096 Mar 16 13:13 Hallo

-rw-r--r-- 1 root root    0 Mar 16 13:02 asdf

drwxr-xr-x 2 root root 4096 Mar 16 13:16 hacktor

fuckup ftp # 

```

first one is with sshfs mounted to hacktor

second is unmounted sshfs

----------

## Hu

Perhaps vsftpd is reacting badly to the directory being owned by root.  If you chown the directory to ftp:ftp after the sshfs is mounted, does the ftp client work correctly?

----------

## sege

I dont think thats the problem.

I think you read the log above the wrong way.

With sshfs mounted to hacktor, the directory is owned by ftp:ftp

This is the time, when it doesnt show up.

After unmounting its owned by root and DOES show up.

I dont know what wrong.

----------

## Hu

That is exactly what I understood it to say.  My point was that vsftpd may be examining the ownership of the directory and making a decision based on that ownership.  Please try as I asked and chown the mounted sshfs to root:root before starting the ftp client.

Another possibility, which may be more likely, is that vsftpd is reacting to the presence of a mount point.  If you mount a traditional hierarchy, such as a CD, at that location, what happens?

----------

## sege

Okay, now I understand.

I tried chowning the directory to root:root .

But that doesnt help. It doesnt show up. Like before.

Know I made a new directory and mounted my boot partition there.

I can access this directory without problems via ftp. 

Thats weird !

----------

