Posts

Showing posts from July, 2008

Manipulating Files

chmod : The chmod command allows you to alter access rights to files and directories. the shell prompt type: ls -alt You should see some files with the following in front of them example: drwxrwsr-x 7 rajesh 1024 Apr 6 14:30 drwxr-s--x 22 rajini 1024 Mar 30 18:20 d-wx-wx-wx 3 Cheguevara1024 Apr 6 14:30 What do the letters mean in front of the files/directories mean? r indicates that it is readable w indicates that it is writable x indicates that it is executable - indicates that no permission to manipulate has been assigned When listing your files, the first character lets you know whether you’re looking at a file or a directory. It’s not part of the security settings. The next three characters indicate Your access restrictions. The next three indicate your group's permissions, and finally other users' permissions. chmod 755 filename The example above will grant you full rights, group rights to execute and read, and all others access to execute the file. 7 permission Fu...

Directory permissions

Permissions For security reasons, all Unix systems including Linux have file permissions which allow you to control access to directories - who can read, write, or execute a file or command in a directory. In the extreme left is either a d or hyphen (-) indicating whether this is a directory or a file (occasionally you will also see an l indicating a link). Then you see three groups of the same three letters in the same order: r for read, w for write, x for execute, and the hyphen (-) for no permission given in that type. The first group of three letters is for the owner, the second group for the group, and the third the world. Whoever creates the file is the owner, and if more than one person is working on a project or needs access to this file they are given permission as a group, and finally how the file is open to anyone who has access to the system (the world). chmod, chown, chgrp The command to change file permissions is chmod (change mode). There are two ways for do...