• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Unable to SFTP (due to?) & Incorrect chown/chmod rights

DaniëlB1990

New Pleskian
Hello!

I'm struggling quite some time now to get my Ubuntu 16.04.5 LTS server with Plesk back to fully functioning but haven't had to much at at doing so.

The problem is currently that my chown, and possibly chmod rights aren't set with the correct rights and/or owner, which possibly makes me unable to log in on the SFTP of dbweb, for example 'ishetalbijna' is another user that is being chown'ed to folders of sites I host on it. "ls -lh /var/www/vhosts/*\.nl/", but I'm also unable to connect to the SFTP of "ishetalbijna" or any other SFTP user.

I've tried to repair it with options below but unfortunately had no luck restoring it correctly.
  • Tools & Settings > Diagnose & Repair > Check all / Repair all
  • Tools & Settings > Diagnose & Repair > File System > Check / Repair
  • plesk repair fs -y
  • plesk repair fs -vhost -y
  • plesk repair fs utility doesn't set correct ownership if apache user is a file owner seemed somewhat the same
    • Resolution ( but this doesn't hit chroot other folders other then httpdocs )
      Code:
      root@arcee ~ # grep db-webdiensten.nl /etc/passwd | head -1
      dbweb:x:10002:1003::/var/www/vhosts/db-webdiensten.nl:/opt/psa/bin/chrootsh
      root@arcee ~ # chown dbweb:psaserv /var/www/vhosts/db-webdiensten.nl/
      root@arcee ~ # chown dbweb:psaserv /var/www/vhosts/db-webdiensten.nl/httpdocs
      root@arcee ~ # chown dbweb:psacln /var/www/vhosts/db-webdiensten.nl/httpdocs/*
      root@arcee ~ # find /var/www/vhosts/db-webdiensten.nl/httpdocs/* -type d -exec chmod 0755 {} \;
      root@arcee ~ # find /var/www/vhosts/db-webdiensten.nl/httpdocs/* -type f -exec chmod 0644 {} \;
    • PPPM-8271_fix_advisor.sh
  • Creating my own chmod/chown bash script to restore one by one based on: Virtual Host Structure (Linux)
    Code:
    chown dbweb:psaserv /var/www/vhosts/db-webdiensten.nl
    chmod 0755 /var/www/vhosts/db-webdiensten.nl
    
    if [ -f "/var/www/vhosts/db-webdiensten.nl/anon_ftp" ]; then
        chown dbweb:psaserv /var/www/vhosts/db-webdiensten.nl/anon_ftp
        chmod -R 0750 /var/www/vhosts/db-webdiensten.nl/anon_ftp
    fi
    
    chown dbweb:psacln /var/www/vhosts/db-webdiensten.nl/error_docs
    chmod -R 0755 /var/www/vhosts/db-webdiensten.nl/error_docs
    
    chown dbweb:psaserv /var/www/vhosts/db-webdiensten.nl/error_docs
    chmod -R 0755 /var/www/vhosts/db-webdiensten.nl/error_docs/*.*
    
    chown dbweb:psaserv /var/www/vhosts/db-webdiensten.nl/httpdocs
    chmod -R 0750 /var/www/vhosts/db-webdiensten.nl/httpdocs
    
    if [ -f "/var/www/vhosts/db-webdiensten.nl/httpdocs/cgi-bin" ]; then
        chown dbweb:psaserv /var/www/vhosts/db-webdiensten.nl/httpdocs/cgi-bin
        chmod -R 0755 /var/www/vhosts/db-webdiensten.nl/httpdocs/cgi-bin
    fi
    
    chown -R root:root /var/www/vhosts/db-webdiensten.nl/bin
    chmod -R 0755 /var/www/vhosts/db-webdiensten.nl/bin
    
    chown -R root:root /var/www/vhosts/db-webdiensten.nl/dev
    chmod -R 0755 /var/www/vhosts/db-webdiensten.nl/dev
    
    chown -R root:root /var/www/vhosts/db-webdiensten.nl/etc
    chmod -R 0755 /var/www/vhosts/db-webdiensten.nl/etc
    
    chown -R root:root /var/www/vhosts/db-webdiensten.nl/lib
    chmod -R 0755 /var/www/vhosts/db-webdiensten.nl/lib
    
    chown -R root:root /var/www/vhosts/db-webdiensten.nl/lib64
    chmod -R 0755 /var/www/vhosts/db-webdiensten.nl/lib64
    
    chown -R root:root /var/www/vhosts/db-webdiensten.nl/tmp
    chmod -R 0755 /var/www/vhosts/db-webdiensten.nl/tmp
    
    chown -R root:root /var/www/vhosts/db-webdiensten.nl/usr
    chmod -R 0755 /var/www/vhosts/db-webdiensten.nl/usr
    
    chown -R root:root /var/www/vhosts/db-webdiensten.nl/var
    chmod -R 0755 /var/www/vhosts/db-webdiensten.nl/var
    
    if [ -f "/var/www/vhosts/db-webdiensten.nl/httpdocs/web_users" ]; then
        chown root:root /var/www/vhosts/db-webdiensten.nl/httpdocs/web_users
        chmod 0755 /var/www/vhosts/db-webdiensten.nl/httpdocs/web_users
        
        chown -R dbweb:psaserv /var/www/vhosts/db-webdiensten.nl/httpdocs/web_users/*
        chmod -R 0750 /var/www/vhosts/db-webdiensten.nl/httpdocs/web_users/*
    fi
    
    find /var/www/vhosts/db-webdiensten.nl/httpdocs*/* -type d -exec chmod 0755 {} \;
    find /var/www/vhosts/db-webdiensten.nl/httpdocs*/* -type f -exec chmod 0644 {} \;

Nothing seems to work, so there for I'd like to call in help on this case, so I'm able to restore everything back to its original rights, which several other ways aren't capable of and lets me get back to work.

For additional information, please take a look at:
Hope to hear from you guys soon and have a happy new year ;-)
 
Last edited:
Since my post has moved to page 4 I'd like to bump up my post with this reply, does anyone have idea's to to resolve my case?

Thanks in advance!
 
Back
Top