Tag: permission

Synology vi modify file ACL unintentionally

Synology vi modify file ACL unintentionally

When using vi editor in Synology SSH session, the ACL changed upon saving. This causes issue for permission sensitive application, such as SSH.

Cause

The vi command creates a new file, and write new contents into that file, and the new file doesn't follow the ACL of original file.

Update ACL using GUI

If SSH is not available, for example, the permission authorized_keys changed, and only public key access was opened. If the file was shared, GUI is allowed to change ACL in user's home directory.

The ACL page can be accessed using following steps.

  • Login DSM webpage
  • Right click on the file
  • Select Properties
  • Click on Permission Tab

View ACL from command line

In Synology, use following command to check file ACL

/usr/syno/bin/synoacltool -get <PATH>

Remove ACL from command line

To remove ACL, using following command

/usr/syno/bin/synoacltool -del <PATH>

Edit ACL from command line

For example, remove @users group from usbshare1

/usr/syno/sbin/synoshare --setuser usbshare1 RW - "@users"

Other options

More options can be found using following command

/usr/syno/bin/synoacltool -h

References

Manage Windows ACL with Command Line Interface ?