Permission management in Linux

 

You can assign rights in Linux by using command chown. It’s easy, all you need is to know which file/s or folder/s you need to assign the permission, and you have right to do so (for instance if you are root user).

This example shows how to assign user1 permission on folder /test. To do so type: chown user1 /test.

assign user in Linux

To be sure that the it works, check it by typing: ls –l

list assigned user in linux

As you see now the user user1 have the drwxr-xr-x permissions. Same as it was initially only for root.

To check how to set the right for on files and folder please follow this article.

How to set permission of folder or file in Linux

You can set permission for the folder or file in Linux system by using command chmod.

For instance to setup the /test folder permission to 777 you need to type: chmod 777 /test.

change persmission linux

To check that 777 is really set use stat command: stat /test

check folder permission in Linux

You can clearly see that folder is set to 777 permission.

To process bundle action with folders and sub folders use the following example: chmod –R /test. This will setup all folders, files and subfolders to 777.

However there might be another way to do it either for folders&subfolders: find /test/ -type d -exec chmod 777 {} \;

or for the all files in all folders and subfolders: find /var/www -type f -exec chmod 777 {} \;

Be very careful with permission 777, this is shown only for example purposes.

How to check last reboot on your Linux system

It is necessary from time to time check when you Linux server was restarted. It might be interesting for security reason, when somebody had access to your server and reboot it. Also it is useful to know how stable is your server, how often it was restarted, manually or independently due to hardware, kernel or software crash.

You the following command: last reboot
last reboot linux

Which Linux to choose

My first experience with linux was in 1997 when I've tried SlackWare linux 5.0. I remember how I've installed it and look like a reindeer on black screen waiting for the interface, but see nothing, only black screen and #root with blinking cursor. Well… I continued to use Windows NT 4.0 server and silently thinking about linuxzzzz guys as masochists stacked in DOS era. Until bad stuff happened. The project I appeared to be involved in requested from me to create file server for my Linguistics University library with 10 500 000 small TXT files obtained from metropolitan. Having quite fast SCSI in RAID-5 devices I couldn't realize why the performance is so slow. Another fact that this library set could contains up to 60 sub sub sub folder in depth with different languages folders names and up to 13000 thousands files per folder, by which smart gurus explained me that NTFS file system will not cope with it. 

Continue reading