Welcome - 10/07/17

Working in Teams

ALE - Atlanta Linux Enthusiasts

Thanks for coming out!
We are volunteers. Just some guys trying to spread Linux knowledge.

Hands-On Today


Get your Linux Computers up
Open a Terminal

Building Blocks to Help Teams Work Together


Beginning Users & Groups


Linux is Multi-User

Adding Users & Groups


For simple environments,
with local userids,
these tools just modify:

  • /etc/passwd
  • /etc/shadow
  • /etc/groups
  • /etc/gshadow

There are multiple commands for adding and managing users.

Examples - Adding users


$ sudo adduser pete   # add a userid pete to the local system 
$ id pete             
$ sudo deluser pete   # delete the userid - don't do this yet

Examples - Putting a Userid into a Group


$ sudo gpasswd -M pete {group}
$ id pete

Break!



Break - 5 minutes

Permission Modes


Number   Ref    Octal Permission Representation
 ===     ===    ==================================
  0      ---    None
  1      --x    Execute 
  2      -w-    Write 
  3      -wx    Execute and write : 1 (execute) + 2 (write) = 3
  4      r--    Read 
  5      r-x    Read and execute : 4 (read) + 1 (execute) = 5
  6      rw-    Read and write : 4 (read) + 2 (write) = 6
  7      rwx    All : 4 (read) + 2 (write) + 1 (execute) = 7

Beginning File and Directory Permissions (chmod)


drwxrwxrwx

Basic File Permissions


Example: Basic File Permissions


$ cd /tmp
$ touch foo
$ chmod 0400 foo
$ chmod 0600 foo
$ chmod 664 foo
$ chmod 644 foo
$ chmod 752 foo
$ chmod 750 foo
$ chmod 777 foo # only for lazy people who don't understand security

Example: Basic File Permissions Symbols


$ cd /tmp
$ chmod g=rwx foo
$ chmod g+s foo
$ chmod o-a foo
$ chmod o+r foo
$ chmod u=rwx,g=rw,o=r foo
$ chmod ugo+r,u+wx,g+w foo

Example: Basic Directory Permissions

$ cd /tmp
$ mkdir boo
$ chmod 740 boo
$ cd boo ; cd ..
$ chmod 644 boo
$ cd boo ; cd ..
$ chmod 711 boo
$ chmod 775 boo
$ chmod 550 boo

Working Together


  1. Put everyone into the same group.
  2. Create a directory where they can share files.
  3. Make the group on that empty directory have rws permissions
           $ sudo gpasswd -M  user1,user2,user3  ourgroup
           $ mkdir -p /tmp/Workspace
           $ chmod g=rwxs Workspace
           $ ls -l Workspace
              drwxrws---   owner    group    Workspace/ 
           $ chgrp ourgroup Workspace
           $ ls -l Workspace
              drwxrws---   owner    ourgroup    Workspace/ 

More Working Together


           drwxrws---   owner    ourgroup    Workspace/ 

Not the Whole Story on Permissions


Calendar


      September             October               November              
 Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa  Su Mo Tu We Th Fr Sa 
                 1  2   1  2  3  4  5  6  7            1  2  3  4
  3  4  5  6  7  8  9   8  9 10 11 12 13 --   5  6  7  8  9 10 --
 10 11 12 13 14 15 16  15 16 17 18 19 20 21  12 13 14 15 16 17 --
 17 18 19 20 21 22 23  22 23 24 25 26 27 28  19 20 21 22 23 24 --
 24 25 26 27 28 29 30  29 30 31              26 27 28 29 30      
 

Thanks / Feedback


blog.jdpfu.com