Linux file permissions

chmod 4755 (rwsr-xr-x)

Owner: read, write, execute · Group: read, execute · Others: read, execute

4755numeric
rwsr-xr-xsymbolic
7 · 5 · 5owner · group · others
Commands
chmod 4755 filename chmod u=rwx,g=rx,o=rx filename # plus u+s chmod -R 4755 folder/ # apply to a folder and everything in it

Change any permission with the chmod calculator.

What chmod 4755 means

WhoDigitLettersCan
Owner (user)7rwsread, write, execute
Group5r-xread, execute
Others5r-xread, execute

Each digit is the sum of read (4), write (2) and execute (1). The leading 4 is a special bit: setuid — the program runs with the privileges of the file’s owner.

When to use 4755

Programs that must run with their owner’s privileges (setuid), such as passwd.

Related permissions

Questions

What does chmod 4755 mean?

chmod 4755 sets the permissions to rwsr-xr-x: the owner can read, write, execute, the group can read, execute and others can read, execute. The leading digit sets special bits (setuid).

When should I use 4755?

Programs that must run with their owner’s privileges (setuid), such as passwd.

What is 4755 in symbolic form?

4755 is rwsr-xr-x (shown by ls -l as -rwsr-xr-x for a file or drwsr-xr-x for a folder). The symbolic chmod command is chmod u=rwx,g=rx,o=rx file.