All tags
permissions
Narrow down
Shell25
- Tip
[Service]StateDirectory= gives a systemd service its own folder under /var/libLet systemd create and own the data folder of a service, with the right user.30 Nov 2026 - Tip
sudo su -s /bin/bash www-datasu -s /bin/bash www-data tests permissions as a user that has no login shellOpens a shell as a service account to try file access step by step.30 Nov 2026 - Tip
sudo setfacl -R -d -m g:media:rwX /srv/mediaSetfacl -d sets default permissions that every new file in a folder inheritsMakes new files in a shared folder get the right ACL automatically.30 Nov 2026 - Tip
sudo cp -r /srv/site /srv/site.rcp -a keeps owner, group and permissions, plain cp -r does notCopies a folder while keeping its owners, modes, timestamps and links.30 Nov 2026 - Tip
sudo journalctl -k --since '10 min ago' | grep 'apparmor="DENIED"'Permission denied with correct permissions often means AppArmor said noFinds AppArmor denials in the kernel log when chmod and chown look right.30 Nov 2026 - Tip
sudo systemctl edit myapp.serviceUMask= in a systemd unit sets the permissions of every file a service createsControls the default mode of new files written by one service.30 Nov 2026 - Tip
sudo usermod -G users aliceUsermod -G without -a wipes a user's other group permissionsShows why adding a group always needs the append flag.30 Nov 2026 - Tip
sudo tar --numeric-owner -cpf app.tar -C /srv appTar with numeric owners keeps file permissions right when you restore on another machineStores and restores owners by number, so a restore elsewhere gets the right owners.30 Nov 2026 - Tip
sudo getfacl -R -p srv/data > /root/data-perms.aclGetfacl -R saves the permissions of a whole tree, and setfacl puts them backBacks up owners, modes and ACLs of a folder tree to one text file.30 Nov 2026 - Tip
sudo usermod -aG systemd-journal $USERThe systemd-journal group lets you read every log without sudoRead the system journal as your normal user, without typing sudo every time.27 Nov 2026 - Tip
sudo chown alice: report.pdfChown alice: with a trailing colon also sets the user's own groupGives a file to a user and that user's own group in one short command.27 Nov 2026 - Tip
sudo mount -o uid=1000,gid=1000,fmask=0133,dmask=0022 /dev/sdb1 /mnt/usbChmod does nothing on a FAT USB stick, set uid and umask when you mount itMakes a FAT-formatted USB drive writable for your own user with mount options.27 Nov 2026 - Tip
grep -E '^(HOME_MODE|UMASK)' /etc/login.defsHOME_MODE and DIR_MODE decide the permissions of new home foldersSets how private the home folder of every new user account is.27 Nov 2026 - Tip
sudo tailscale set --operator=$USERTailscale set --operator lets your own user run tailscale without rootGives one Linux user the right to operate tailscaled, so routine commands need no sudo.26 Nov 2026 - Tip
sudo setfacl -m u:alice:rX /srv/dataSetfacl gives one extra user access without changing the groupGives one extra named user access to a folder without touching owner or group.11 Sep 2026 - Tip
stat -c '%a %U:%G %n' /etc/ssh/sshd_configstat -c prints the permissions as numbersPrints a file's permissions as an octal number with owner, group and name.18 Aug 2026 - Tip
sudo getcap -r / 2>/dev/nullGetcap -r / lists the programs that carry extra permissionsLists all files on the system that have file capabilities set.19 May 2026 - Tip
sudo setcap 'cap_net_bind_service=+ep' /usr/local/bin/myappSetcap lets a program bind port 80 without root permissionsGrants a program the right to open low ports without running it as root.19 May 2026 - Tip
sudo chown -c -R --from=1000:1000 www-data:www-data /srv/siteChown --from changes the owner only where the old owner matches, a permissions-safe filterChanges the owner of only the files that currently belong to a given user or group.18 May 2026 - Tip
sudo chattr +i /srv/app/settings.confChattr +i makes a file immutable, which normal permissions cannot do for rootLocks a file against any change, including by root, until the flag is removed.15 Feb 2026 - Tip
sudo -u www-data test -r /srv/site/config.php && echo can read || echo blockedsudo -u www-data test -r proves the web server really has the permissionsTests whether another user, such as the web server, can read or write a path.14 Feb 2026 - Tip
sudo chmod --reference=/etc/ssh/sshd_config /etc/ssh/sshd_config.newChmod --reference copies the permissions of another fileGives one file exactly the mode of another file.9 Feb 2026 - Tip
sudo install -m 640 -o root -g www-data app.env /etc/app/app.envInstall -m sets permissions, owner and group while it copies the fileCopies a file and sets its mode, owner and group in one command.8 Feb 2026 - Tip
sudo chmod 1777 /srv/dropboxChmod +t sets sticky permissions, so nobody deletes the files of othersStops users from deleting each other's files in a folder everyone can write to.5 Feb 2026 - Tip
sudo chmod g+s /srv/sharedChmod g+s on a shared folder fixes the group permissions of new filesMakes new files in a directory inherit its group, so a team can share the folder.5 Feb 2026
Other tips11
- Tip
setfacl -m m::rx fileThe ACL mask caps what named users and groups can doExplains the mask entry, and how setfacl -m m::rx removes write access from all named entries at once.3 Dec 2026 - Tip
find / -xdev -user olduser -ls 2>/dev/nullfind -user lists everything one account ownsLists the files that belong to one user, for a cleanup or before you remove the account.30 Nov 2026 - Tip
newgrp medianewgrp gives your shell the permissions of a new group without logging outStarts a shell that already has a group you were just added to.30 Nov 2026 - Tip
find ~/bin /usr/local/bin -type f -executablefind -executable checks whether you can run a file, not only the x bitLists the files the current user can actually execute, instead of guessing from permission bits.30 Nov 2026 - Tip
rotate 4The su line in logrotate fixes "parent directory has insecure permissions"Let logrotate rotate logs in a folder that a normal user or app can write to.27 Nov 2026 - Tip
umask 027umask decides the permissions of every new fileSets the default permissions for new files and directories so others get no access.6 Sep 2026 - Tip
chmod -R u=rwX,go=rX /srv/siteUse a capital X in chmod so only directories get executeSets sensible permissions in one pass: execute only on directories and already-executable files.24 Aug 2026 - Tip
ls -l report.odt # -rw-r-----+A plus sign after the permissions in ls -l means an ACL adds more rulesShows how to spot extra access rules that ls -l hides behind a plus sign.11 Feb 2026 - Tip
chmod g=u,o= notes.txtchmod g=u gives the group the same permissions as the ownerCopies the owner's permission bits to the group and clears them for others.10 Feb 2026 - Tip
idid shows the groups you have now, so new permissions need a new loginCompares the groups of the current session with the groups stored for the account.7 Feb 2026 - Tip
chmod 711 /tmp/demoDirectory permissions 711 let users enter a folder but not list itExplains the directory execute and read bits, and how 711 allows access without listing.6 Feb 2026
AI4
- Tip
"permissions": {Allow WebFetch per domain so Claude Code reads your docs without askingLets Claude fetch pages from chosen sites without a prompt and keeps asking for the rest.30 Nov 2026 - Tip
"permissions": {Set defaultMode to plan so Claude Code starts every session by reading firstMakes new Claude Code sessions open in plan mode instead of asking per edit.30 Nov 2026 - Tip
claude -p "Check the docs folder for broken internal links and list them" \Run claude -p in dontAsk mode so a CI job never waits on a Claude promptDenies every action that would need approval and lets only your allowed tools run.30 Nov 2026 - Tip
"permissions": {Deny Read(./.env) so Claude never opens your secretsStops Claude Code from reading your .env file by adding a deny rule to settings.14 Aug 2026
Docker4
- Tip
ls -ln /srv/datals -n shows owners as numbers, which explains odd permissions on shares and containersPrints UIDs and GIDs instead of names, so mismatched IDs become visible.30 Nov 2026 - Tip
sudo gpasswd -d alice dockerGpasswd -d removes a user from one group and leaves the rest of their permissions aloneTakes one user out of one group without touching other memberships.30 Nov 2026 - Tip
capsh --printcapsh shows which capabilities a process has beyond normal permissionsLists the Linux capabilities of the current shell, including inside a container.30 Nov 2026 - Tip
id nobodySet PUID=99 and PGID=100 so a container writes files as nobody:users on UnraidMakes an Unraid container create its files as nobody:users, the owner your shares expect.28 Nov 2026
Git3
- Tip
git config core.fileMode falseCore.fileMode false makes git ignore permission changesStops git from reporting files as changed when only their executable bit changed.30 Nov 2026 - Tip
"ask": ["Bash(git push *)"]An ask rule makes Claude Code check with you before every git pushForces a confirmation prompt for chosen commands, even in modes that would allow them.30 Nov 2026 - Tip
claude -p "Look at my staged changes and create an appropriate commit" \Scope --allowedTools to single git commands, with a space before the starLets a scripted Claude Code run use only the git commands you list, without prompting.24 Jul 2026
Storage2
- Tip
UUID=<your-uuid> /mnt/backup ext4 noauto,user 0 0The user option in fstab lets you mount a disk without sudoLets a normal user mount and unmount one disk from fstab without root.27 Nov 2026 - Tip
icacls D:\Share\* /save D:\acl-backup.txt /ticacls /save backs up Windows folder permissions before you change themSaves the permissions of a folder tree to a file, so you can restore them after a mistake.26 Nov 2026
Web1
Posts1
Nothing matches.