DocumentRoot Confirmation

Discussion in 'ISPConfig 3 Priority Support' started by yupthatguy, Jul 13, 2021.

  1. yupthatguy

    yupthatguy Member HowtoForge Supporter

    I just want to quickly confirm that configs are correct and that nothing errant is happening, before I start moving building sites.

    Every time I create a website under Domain, it creates a vhost with a DocumentRoot that points to

    DocumentRoot /var/www/clients/client21/web39/web

    However, when I create a shell-user for the same website, points to

    Base Dir: /var/www/clients/client21/web39

    which results in me having to constantly use #cd /web not a big deal, but ssh directly into the web folder would save a little time.

    I tried changing

    Base Dir: /var/www/clients/client21/web39

    to

    Base Dir: /var/www/clients/client21/web39/web

    But the entire web folder vanished and I got 403 error on the domain.

    I expected to be able to SSH directly in the web folder, rather than needing to cd /web, every time, so I would like quick confirmation that my server config is correct or not. Is this expected behavior?
     
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Your server config is correct and as intended, the root directory for SSH users shall not be the docroot of the web server as ssh users can and shall be able to access some folders outside of the webroot like the private folder. using the same root for ssh users and web server would be really insecure as this would mean that all private directories of the shell user would be accessible by http.
     
  3. yupthatguy

    yupthatguy Member HowtoForge Supporter

    Thx for the quick confirmation...

    For any interested, I found a quick workaround that I use with a bash alias that will ssh directly into the directory without having to use #cd /web so much

    Code:
    alias test="ssh -t -i ~/.ssh/id_rsa [email protected] 'cd /web && bash'"
    
     

Share This Page