some SSHFS dirs showing up as broken files

Discussion in 'General' started by schwim, Mar 9, 2023.

  1. schwim

    schwim Member HowtoForge Supporter

    Hello there!
    I'm posting this in ISPC and not linux because the issue is only happening on my new Deb 11 ISPC 329pl1 server. All of my other servers are still working correctly.
    I connect to my servers via SSHFS in my desktop deb install. Mounting the drives, I'm able to work on my sites in the web or public_html directories.
    Only on the new install, the dir named web shows up as a broken location and not a directory while .ssh shows up and operates as expected. It says the broken file is owned by root but when I look in my ISPC site panel, it says the owner of the site is the client account I created. Would anyone know what I need to do to gain access to these directories in this account?
    [​IMG]
     
  2. schwim

    schwim Member HowtoForge Supporter

    Looking into a bit more:
    Would I be safe just to chown / chgrp these dirs and files to the proper user and group?

    Second question, how do I keep this from happening every time I create a new site?
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    You are logged in as a shell user of that site and the output shows that the permissions are correct. You are currently in the home folder of that ssh user that you logged in with, not the website root.

    So why do you want to destroy the correctly set up website by changing its permissions so that it stops working? Make no sense to me.

    Prevent what from happening, that websites get set up correctly?
     
  4. schwim

    schwim Member HowtoForge Supporter

    Thanks for your help and I'm not sure if hyperbole is necessary here as I'm not trying to destroy anything. I'm simply trying to allow users to work with their web directory via sshfs as they would be able to when logging in via sftp.

    Is this something that can be done without destroying the correctly setup website? If so, what steps should I take to do that?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Set your sftp client to mount / or /web instead of the user's home directory.
     
  6. schwim

    schwim Member HowtoForge Supporter

    If I'm not being clear enough, I apologize. Perhaps I'm just logging into SSHFS incorrectly. I'm hoping to be able to mount the user's directory and make it workable, this happens when I log into SSHFS on a site created by cpanel or plesk. I use the same credentials I use for logging the user in via SSH of SFTP to work on their site.

    Perhaps I don't need to modify anything on the server side but instead need to do something in the way of creating a user specifically allowed to work in web that the site owner can use to manipulate ~/web via SSHFS?

    Sorry for any confusion caused, I'm coming up to speed on what changes I need to make to migrate sites over from a cPanel server.
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    The website directory is /web when you login with a jailed user and not ~/web. What you call broken permissions is named a symlink on Linux, see: https://en.wikipedia.org/wiki/Symbolic_link and this link exists for easy shell navigation when logged in with an interactive shell.
     
  8. schwim

    schwim Member HowtoForge Supporter

    I'm sorry for the confusion, I'm not using ~ in the mounting attempt. Here's an example of trying to mount web and what error results. It's telling me that web is not a directory.


    https://i.imgur.com/PR9nEse.png
     
  9. schwim

    schwim Member HowtoForge Supporter

    Should I perhaps recreate the SSH user without jailkit to make this work?

    EDIT: I tried that but the directory still shows as not existing:

     
  10. till

    till Super Moderator Staff Member ISPConfig Developer

    Now, you are using a non-jailed ssh user. For a jailed user, the website directory is /web. For a non-jailed user as you are using it now, the directory is /var/www/clients/client1/web1/web
     
    schwim likes this.
  11. schwim

    schwim Member HowtoForge Supporter

    I see. What am I doing wrong when I use pwd after shelling in that I see:

    instead of:
     
  12. till

    till Super Moderator Staff Member ISPConfig Developer

    You are doing nothing wrong. You just don't seem to understand what the pwd command is and what it shows you. The pwd command shows you the home directory of the logged-in user, but the logged-in user's home directory is not your website root directory of course. A website can have many users, and each user has its own home directory, and this home directory is what the pwd command shows you. The website, though, is always in /web when your shell user is jailed or a path like /var/www/clients/client1/web1/web when the web user is not jailed. And any web user that you add to a website has full access to the websites web directory.
     
    Th0m likes this.
  13. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    My signature has link to tutorial for mounting SSHFS on desktop. The Connect File Manager to website.
     
    ahrasis likes this.
  14. schwim

    schwim Member HowtoForge Supporter

    That's what I was misunderstanding, I wasn't taking into account symlinking being different for ssh users and pictured instead each ssh user having access to the source directory. I am still figuring it all out but once you set me straight as to the actual directory to work in, everything started working. Thank you very much for that.

    I'm reading it now, thank you very much for pointing me toward it.
     
    ahrasis likes this.

Share This Page