I can't change chmods or other subdomain operations

Hello,

On the subdomain on the server, I can’t change chmods for reading and writing and I can’t perform any operation why is this happening or does it depend on the server settings ??

Hello @shryus,

Could you please give us more details about what are you trying to do and how?

Through the console as root, I moved my project from a domain to a subdomain, but I noticed that I can’t delete files in folders or add files to folders, and I can’t even change chmod .

What you moved? Files in /home/user/web/yourdomain/public_html/* to /home/user/web/yoursubdomain/public_html/ or did you do any other thing?

How are you trying to do add/delete files etc., with root user, any other user, via ssh, via web file manager, ftp, sftp…?

That is the reason I’m asking for details, if we don’t know what and how you are doing it, we can’t help you but anyways, seems a permissions problem.

Yes, I moved the files from /home/user/web/yourdomain/public_html/* to /home/user/web/yoursubdomain/public_html/ via ssh console because I wanted to shorten the transfer time

I use the filezilla program and through it I do all the operations on the files that I have on the server.

Show the output of (change user and yoursubdomain by the actual data):

ls -la /home/user/web/yoursubdomain/public_html/

This is how it looks and I don’t know why the rights for the user do not work on sftp because as a root user through consoles it works and on sftp it does not work

Zrzut ekranu

NSA documents have less hidden data :stuck_out_tongue:

The user you hide in /home/xxxxxx and the user and group you hide in the files are the same? When you connect using filezilla you are using ftp or sftp and it is the same user?

Yes it is the same user when connected via sftp

Show the output of this command but please, don’t hide the users, copy the output to an editor and replace the real user name with another fake user name and the same with your sub domain:

namei -mo /home/user/web/yoursubdomain/public_html/blockuser.php

Console result

root@vps-b37c9eb2:~# namei -mo /home/user/web/yoursubdomain/public_html/blockuser.php
f: /home/user/web/yoursubdomain/public_html/blockuser.php
 drwxr-xr-x root     root     /
 drwxr-xr-x root     root     home
 drwxr-xr-x root     root     mbpulawy
 drwxr-xr-x root     user web
 dr-xr-x--x user user yoursubdomain
 drwxr-x--x user www-data public_html
 -rw-r--r-- user user blockuser.php

mbpulawy is not the same as user? Because if they are different, yes you have a problem :wink:

mbpulawy - This is the user I just typed user there

Then the perms look fine, do you have the same problem using ftp instead of sftp?

I don’t know because I only use the sftp protocol because that’s how I have hestiacp installed because sftp is safer than ftp,
but how to transfer through ssh consoles, there are problems with user permissions, but when I add files normally, everything works, someone explain to me why this is happening??

What is the exact error you get using filezilla? If you are on Windows, did you try another client like WinSCP?

Please, show the output of these commands:

grep 'Subsystem' /etc/ssh/sshd_config
grep -A8 'Hestia' /etc/ssh/sshd_config
grep -i '^mbpulawy' /etc/passwd /etc/group

Returns the results of commands

root@vps-b37c9eb2:~# grep 'Subsystem' /etc/ssh/sshd_config
Subsystem sftp internal-sftp

root@vps-b37c9eb2:~# grep -A8 'Hestia' /etc/ssh/sshd_config
# Hestia SFTP Chroot
Match User sftp_dummy99,admin,grobnet,twoj-host,cmentarz_online,raf-comp,palmywielkanocne,mbpulawy,gszafranek
ChrootDirectory %h
    X11Forwarding no
    AllowTCPForwarding no
    ForceCommand internal-sftp

root@vps-b37c9eb2:~# grep -i '^mbpulawy' /etc/passwd /etc/group
/etc/passwd:mbpulawy:x:1007:1007:[email protected]:/home/mbpulawy:/sbin/nologin
/etc/group:mbpulawy:x:1007:

I see no problem, all looks good. Sorry but don’t know what is going on.

Try another client like WinSCP if you are using Windows or even try to connect using sftp from your own hestia server.

sftp mbpulawy@localhost if you are not using standard port 22 sftp -PHereThePort mbpulawy@localhost

And go to the public_html dir and try to rename or change perms of some file

Example changing perms of file blockuser.php using sftp from command line

$ sftp mbpulawy@localhost
mbpulawy@localhost's password: HereTheUserPassword
sftp> cd web/yoursubdomain/public_html/
sftp> ls -l blockuser.php
sftp> chmod 664 blockuser.php
sftp> ls -l blockuser.php
sftp> quit

Ok now it works thank you for your help through another client I connected and it works thanks a lot

I’m glad it works again :wink: