Odd ftp issue: username defines site

Discussion in 'General' started by bidevi, Apr 24, 2010.

  1. bidevi

    bidevi New Member

    Strange thing in Lenny/ISPCongif3: 1 server (example1.domain.com), 2 sites with 2 users: site1 with user1, site2 with user2.

    Ftp works alright, but if I choose:

    Server: site1
    Username: user2

    site 2 opens where I chose site1.

    What is wrong and how to solve it?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Which ISPConfig version?
     
  3. bidevi

    bidevi New Member

    Strange thing in Lenny/ISPCongif3
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    ISPConfig 3 is the name of the software and not the version. So which exact ISPConfig version do you use.
     
  5. bidevi

    bidevi New Member

    ISPConfig, latest version: 3.0.2.1
     
  6. till

    till Super Moderator Staff Member ISPConfig Developer

    Delete both ftp accounts and then recreate them as admin user.
     
  7. bidevi

    bidevi New Member

    How do you create a non-admin or an admin user? What must I do differently?
     
  8. bidevi

    bidevi New Member

    Again: how to (re)create an ftp-account as admin user? I don't see that option. What I see in the ISPConfig3 panel is:

    Username [CLIENTNAME]anyname

    Clientname is not optional, only anyname is. So what to do?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    To delete a item in ispconfig, click on the delete button in the list, in this case the ftp user list to delete a ftp user. Then add it again.
     
  10. bidevi

    bidevi New Member

    Oh, I did that, to no avail.

    Moreover, I completely installed Lenny/ISPConfig3 again on a second PC, and created:

    1 client
    6 websites assigned to client1 with each its own ftp-user.

    Now, again, when I use ftp to open site1 with ftp-user2, I get to see site2 instead of site1.

    It is no problem, since I know this is the case, but somehow I think it shouldn't be this way.
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Check if the path for the FTP user is correct on the options tab. I use several lenny installs and I can not reproduce this.
     
  12. bidevi

    bidevi New Member

    I checked the ftp users paths in the Options tab and yes, they have all got a different, correct path there.

    So on the FTP User page for site1 I've got:

    UID: web1
    GID: client2
    Directory: /var/www/clients/client1/web1

    For site2 this is:

    UID: web2
    GID: client1
    Directory: /var/www/clients/client1/web2

    and so forth.
     
  13. mike_p

    mike_p Member

    I think I understand what is going on here.

    Each of your sites has an FTP user set up for it. If that is so, each of those FTP users is only allowed to access it's own site (ie the directory set up when the FTP user was created, as in the options tab for the FTP user.)

    However i think what you are doing is trying to go to the FTP address site2.com
    (eg ftp://site2.com) and logging in with ftp user for site1. As far as ftp is concerned, both ftp://site1.com and ftp://site2.com both resolve to the same address. What access is opened up depends on the rights of that FTP user NOT the site address.

    So, the system is working exactly as it should.
     
  14. bidevi

    bidevi New Member

    Yes, your assumption is right. Since all sites belong to client1, in fact I'd like to have only one ftp user for all that client's sites.

    I haven't discovered the option to assign one ftp user to all sites. So what I've tried to do, is check whether ftp user1 could open site2, site3 etc. as well.

    Then I found out that each user gets to see his own site, no matter what site he tries to go to.

    If that's the way the system is ment to work, fine with me.

    But then, is there no way to have one ftp user for more than one site?
     
  15. till

    till Super Moderator Staff Member ISPConfig Developer

    Correct.

    No, as every website runs under its own linux system user, so even if you would be able to see more then one site in the FTP account, you wont be able to access the files from the other sites.
     
  16. mike_p

    mike_p Member

    You can do that by editing the directory in the options tab for the user.
    eg it will default to (for example)
    /var/www/clients/client1/web1
    you could change it to
    /var/www/clients/client1

    The difficulty comes from each site being assigned it's own user (eg web1, web2 etc) as the FTPuser has the rights of only one user (also set on the options tab)
    You could change permissions for site2 to web1. As far as I can tell the only problem would be for suexec (and suPhp?), but if that is the case, you could manually edit the suexec user in the vhost file.
     
  17. bidevi

    bidevi New Member

    Thanks Mike_P, but my life is complicated enough as it is.
     
  18. mike_p

    mike_p Member

    Actually is not very complicated!

    I've just checked a vhost file. The only change you need there is for each site owned by a client you should change SuexecuserGroup to web1 client1

    then as root go to /var/www/clients/client1
    and chown -R web1:client1 *

    So all the sites for client1 are now owned by web1

    Your FTP user now has access to edit all files for all sites owned by client1.

    Perhaps a good future option for ISPConfig: allow a client to use 1 linux user for all sites in his account?
     
  19. bidevi

    bidevi New Member

    This is all there is inside sites-enabled/site2.com.vhost:

    <Directory /var/www/site2.com>
    AllowOverride None
    Order Deny,Allow
    Deny from all
    </Directory>

    <VirtualHost *:80>
    DocumentRoot /var/www/site2.com/web

    ServerName site2.com
    ServerAlias site2.com
    ServerAdmin [email protected]

    ErrorLog /var/log/ispconfig/httpd/site2.com/error.log

    ErrorDocument 400 /error/400.html
    ErrorDocument 401 /error/401.html
    ErrorDocument 403 /error/403.html
    ErrorDocument 404 /error/404.html
    ErrorDocument 405 /error/405.html
    ErrorDocument 500 /error/500.html
    ErrorDocument 503 /error/503.html

    <Directory /var/www/site2.com/web>
    Options FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all

    As you see, there is no SuexecuserGroup to be found.

    So where should I look?
     
  20. mike_p

    mike_p Member

    That means that you aren't using suexec and you don't have to worry about that setting!
     

Share This Page