Linux File Sharing and Permission
telnet and ssh permit users to log in to the server and work together there on shared files. Using tools such as FTP and scp, files developed elsewhere can be placed on the server when users want to permit shared access to those files. All that is required for this type of access is a user account for each user and the necessary daemons to provide the services.
After a user successfully logs in to a Linux server, file sharing is controlled through the file permissions that exist in the Linux filesystem.
Linux File Permission
When the user's account is created, every Linux user is assigned a user ID (UID) and a group ID (GID), which are used to identify the user for file access. Every file is also given a UID and GID. By default, these are the UID and GID of the person who creates it, though that can be changed.
Permissions are granted based on matching the UIDs and GIDs of the file and the user as follows: Owner the permissions granted to the user who has the same UID as the file. they are also called user permissions Group the permissions granted to users who have the same GUID as the file World the permissions granted to all other users, those who have neither the UID nor the GID of the fie. Each of these groups can be granted any combination of three(3) possible permissions: (r) Read permission The contents of the file may be examined (w) Write permission The contents of the file may be modified (e) Execute permission The program contained in the file may be executed Listing 1.0 Examining file permission with ls $ ls -l total 1641 -rw-r--r-- 1 craig users 8255 May 17 14:09 fig2-1.gif -rw-r--r-- 1 craig craig 1349 May 3 2000 trace.txt .. . . . . . . ... . . .. ... . . The very first character indicates whether this is a directory (d), a link (l) or a file (-). In the example above, (see Listing 1.0) all entries are files. The next nine(9) characters are divided into three(3) groups of three(3) to define the permissions for the owner of the file, for the members of the group and for all other users. In Listing 1.0 (above), the owner is granted read and write permissions (rw-), and everyone else --- members of the group as well as other users of the system --- are granted only read access (r - -). |

