Troubles with Ubuntu shortcuts / symbolic link creation...???

My situation is that I've got a test server with a small primary disk.  I've got FTP setup that gives user accounts access to their home directory and locks them there, however, the actual web site roots are stored on an additional hard disk thats mounted at /media/storage.  I need to give access to the web roots stored here to each user from their home directory.  

I tried the following command...

ln -s /media/storage/user/www /home/user/www

What I end up with is an empty /home/user/www folder, however, when I browse it via nautiulus the icon for the new folder has an arrow like a shortcut.  Again, though, it doesn't actually take you to the /media/storage/user/www folder, it's just an empty /home/user/www folder.

Any information on how to fix my issue would be greatly appreciated.  If I'm attaching the problem the wrong way I'm happy to know that as well.  I just need to solve the main issue, which is giving users access to their /media/storage/user/www directory even though they're locked to their /home/user directory via FTP.

Thanks!
LVL 11
Andrew AngellCo-Owner / DeveloperAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kerem ERSOYPresidentCommented:
Hi,

It seems that you have an /hom/user/www folder actually exists in your home directories. Will you please try to link user www homes to another path that does not previously exist. Such as:

ln -s /media/storage/user/www /home/user/w3
0
Andrew AngellCo-Owner / DeveloperAuthor Commented:
No, the folder doesn't already exist.  While playing with ls -l I'm even a little more confused now.  Check out this screenshot I've attached of the command line process I did.

As you can see the www folder did not exist in my home directory when I ran the command.  When I do ls- l afterwards it seems to correctly show it as a shortcut to the /media/storage/angelley/www folder, but then when I do dir or ls- l again right after that it's just an empty /www folder.  

What gives?
command.jpg
0
Andrew AngellCo-Owner / DeveloperAuthor Commented:
And then when I browse to it using Nautilus it does show an arrow like a shortcut, but then when you go into the directory it's just empty and shows it's simply /home/angelley/www


nautilus1.jpg
nautilus2.jpg
0
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

Andrew AngellCo-Owner / DeveloperAuthor Commented:
LOL!!!

I'm really stupid.  the /media/storage/angelley/www folder itself was empty!!!  Wow, how dumb can one person get.  
0
Kerem ERSOYPresidentCommented:
Will you post the ls -al output form /media/storage/angelley/www too ?

The display in nautilus is correct in that it is link rather than a regular folder. The type is indicated correctly along with the icon.
0
Andrew AngellCo-Owner / DeveloperAuthor Commented:
Ah, crap.  Well, my overall goal still isn't working, though.  Now when I FTP I can't get into that linked directory.




ftp.jpg
0
Kerem ERSOYPresidentCommented:
It sometimes happen. When you believe something strongly you might not see the tress from the forest : ))

0
Andrew AngellCo-Owner / DeveloperAuthor Commented:
When I do it from an actual ftp client (cuteftp) it shows the link to /path correctly but then when I try and browse it I get directory doesn't exist.

I connected to my actual web server and the shortcuts they've got show up as link to/path just like mine but they let me browse them just fine.

:(
0
Kerem ERSOYPresidentCommented:
VSFTP disables following the links. vsftp runs in truely chrooted user environment and allowing links would break the rootjail integrity. So it disables them. If you  want to allow this type of links I'll suggest you to use ProFTPD instead of vsftpd.
0
Andrew AngellCo-Owner / DeveloperAuthor Commented:
Well, shoot.  This is getting off subject for this thread but you can tell me quickly how to configure ProFTPD to automatically give user accounts access to their home directory the way vsftpd did?  I've removed vsftpd and installed proftpd but now i'm already wasting time reading through gobs of tutorials trying to figure out why

1) it's telling me connection refused when I try and connect to it
2) how to get it to just use user accounts and give them access to their home directory
0
Morne LateganCommented:
You can also try, with vsftpd:

mkdir /home/user/www
mount --bind /media/storage/user/www /home/user/www

0
Kerem ERSOYPresidentCommented:
> Well, shoot.  This is getting off subject for this thread but you can tell me quickly how to configure
> ProFTPD to automatically give user accounts access to their home directory the way vsftpd did?  I've
> removed vsftpd and installed proftpd but now i'm already wasting time reading through gobs of
> tutorials trying to figure out why

Ok the default configuration for ProFTp should do. The main difference is that: ProFTP does not work in a chrooted anvironment so folowing any lin would not violate anything. So ProFTP should work as you expected with the default configuration What is your porblem using ProFTP ? Can't you  work with default settings?

> 1) it's telling me connection refused when I try and connect to it
In this case it is not working. Will you check if it is active and bind to the port 21?
Issue this command:

netstat -anpt | grep :21

Please post the poutput here.

> 2) how to get it to just use user accounts and give them access to their home directory
It is the default way ProFTP should do.

I'll try to install proftpd. Did you install it wvia apt-get or build from the source?

             
      
0
Andrew AngellCo-Owner / DeveloperAuthor Commented:
I installed it via apt-get.  

I guess I don't have the syntax correct because I can't get anything out of the | grep :21 but here's what I get from netstat -anpt

Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -              
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      -              
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -              
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -              
tcp6       0      0 :::22                   :::*                    LISTEN      -              
tcp6       0      0 ::1:631                 :::*                    LISTEN      -
0
Kerem ERSOYPresidentCommented:
Hi,

I guess it has problems with running from the inetd so pleas to run it a as a standalone service. Though it does not run properli xinaetd thinks it does so birng it to stop first:

# /etc/init.d/proftpd force-stop

Then edit /etc/proftpd/proftpd.conf

find this line:

ServerType                      inetd

Change the line into this:

ServerType                      standalone

Save & exit & restart

/etc/init.d/proftpd start

now it should run.

0
Andrew AngellCo-Owner / DeveloperAuthor Commented:
Ok, well, the good news is switching to standalone allows me to connect and it does seem to be allowing account users to connect and have access to their home directory like I had before with vsftpd.  

The bad news is I seem to be right back where I started with vsftpd.  When browsing the local terminal the shortcut is functioning well, however, when I connect via FTP and try to switch to the www shortcut directly I get directory not found.  I've attached another screenshot.


ftp.jpg
0
Kerem ERSOYPresidentCommented:
Hi,

Then it means that proftpd is working with Chroot environment ( just as VsFTPD did)

Edit the configuration file of proftpd and comment the line :

DefaultRoot ~

So that users are not rootjailed to their homes.

Cheers,
K.
0
Andrew AngellCo-Owner / DeveloperAuthor Commented:
Well, that's the point, though.  I don't want users to have access to the entire machine like that.  I want them trapped to their home but then I want to be able to give them access to certain other folders outside their root that I specify in some way.

If I comment the DefaultRoot ~ wouldn't htat open up the entire machien to FTP users?
0
Morne LateganCommented:
Try the mount command, it works in both "open" systems, and chrooted one's, as the ftp server will see it as being inside the home folder, rather than a link to outside the jail.

mkdir /home/user/www
mount --bind /media/storage/user/www /home/user/www
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Andrew AngellCo-Owner / DeveloperAuthor Commented:
Uberpappa,

I could have sworn I tried that but I guess I must have been too mind-boggled at the time.

I just did tried it again and it seems to be working just fine!!  Thanks!!!!

0
Morne LateganCommented:
Your welcome :)
0
Morne LateganCommented:
Just remember to set it up to do the mounts at system start-up. Unlike links with ln, mounts will not remain active accross system reboots.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.