Kategorie: Linux

Chmod how to understand values

When working with Linux, the user will have to grant or change access rights to files and directories. Use the command to display the access rights to files and directories ls –l.

Permissions are encoded with security bits represented e.g.. by writing:

drwxr-xr-x

The first signs mean:

  • d - stands for directory
  • - means a file
  • l - means a symbolic link

The next nine bits of rwxrwxrwx are responsible for the file or directory access settings:

  • r - readable
  • w - the ability to write
  • x —Possibility to run

The first three bits of the rwx specify the permissions for file owner, the next three define user access security groups, to which the owner of the file belongs, and the last three relate to other system users.

A= Owner B= group C= All (Others)

A B C
chmod 7 7 4

From the example above, chmod can be seen, that:

Owner and group: Full rights
Others: Read only

Explanation of permission numbers - linux

Digit Permissions
0 Lack
1 follow
2 Save
3 Make and save
4 Read it
5 Read and execute
6 Read and write
7 Read it, save and execute

Giving chmod permission to a file or folder

In the terminal through which you give commands to your linux, for example,. Ubuntu, enter e.g.:

chmod 774 nazwaPliku.sh

and click enter.

Thus, you have given permission to the file "filename.sh" 774, that is, the owner and the group have full rights, while others only read. You assigned the permissions from the example above with this method.

Change of file owner - chown

To change the owner of a file, use the command chown, with syntax:

chown owner_name filename

Linux

Udostępnij
Opublikowane przez
Linux

Recent posts

KeePass2 2.52 w Ubuntu 22.04

The guide below describes how to install KeePass on Ubuntu. Całość wykonamy za pomocą kilku poleceń

2 years temu

Installing Master PDF editor in Ubuntu 22.04

Master PDF Editor is a comprehensive PDF program, which includes many features. Oprócz tworzenia i edycji

2 years temu

iotop - memory monitoring

Iotop jest prostym narzędziem dla systemów Uniksowych umożliwiającym monitorowanie użycia dowolnego nośnika pamięci flash/hdd/ssd w

2 years temu

Run multiple commands in one cron job

You can separate two or more commands with semicolons (;), Semicolon (;): służy do oddzielania

2 years temu

Changing the exif data of a photo in the Linux terminal

Poniższy poradnik opisuje w jaki sposób za pomocą konsoli możemy dokonać edycji danych zdjęcia exif.

2 years temu

Installing Rocket.Chat Server on Rocky Linux 8

The following guide describes how to install Rocket.Chat on Rocky Linux 8 Całość bardzo prosto zainstalujemy

2 years temu