Presentation is loading. Please wait.

Presentation is loading. Please wait.

Users/Groups/Permissions

Similar presentations


Presentation on theme: "Users/Groups/Permissions"— Presentation transcript:

1 Users/Groups/Permissions

2 Homework/Lab Issues Lab 1: 8, 11h Homework 2: 1

3 /etc/[passwd|shadow] format
passwd-> sj86672:x:28856:1000:Stuart A Jaskowiak(Blue Ash):/home/sj86672:/bin/ksh shadow-> sj86672:$1$iOk/Ynmi$FIfiuUKYy9K3DuUCr1qmX0 :14122:0:99999:7::: x in column 2 means /etc/shadow has to exist UIDs (column 3) should be unique, but don't have to be /etc/shadow stores password specific info

4 Groups Linux uses a private group by default sj86672:x:1000:
adm:x:4:sj86672 dialout:x:20:sj86672

5 Tools to maintain users/groups
GUI - “System”, “Administration”, “User and Groups” Command Line useradd, usermod, userdel groupadd, groupmod, groupdel vipw, vigr (dangerous)

6 Permissions 3 categories: drwxrwxr-x User (people with same UID)
Group (people with same GID) Other (people with neither) r = 4 w = 2 x = 1

7 Ways to Change Permissions
chmod u+rwx,g-rwx,o-rwx my_file chmod 700 my_file

8 Misc Commands su – switch user passwd – change passwords
With a – and without a - are not 100% identical passwd – change passwords chage – check on password aging

9 Useful Links admin-made-easy/shadow-file- formats.html

10 Permissions, Links and the File System

11 Permissions 3 categories: drwxrwxr-x User Group Other

12 Ways to Change Permissions
Start perms: chmod u=rwx,g=,o= my_file chmod u+rwx my_file chmod 700 my_file End perms: -rwx------ r == 4 w == 2 x == 1

13 Symbolic Links Shortcut to another file (like windows shortcut)
~/cit370 $ ls -l total 1 -rwx sj86672 staff 0 Oct 5 15:09 my_file* lrwxrwxrwx 1 sj86672 staff 7 Oct 5 15:14 other_file -> my_file*

14 Sym link permissions Controlled by originating file not link
Sym link perms: lrwxrwxrwx chmod actually changes permission on linked file!

15 Display filesystem info
df – displays information about disk layout and usage ~]# df Filesystem K-blocks Used Available Use% Mounted on /dev/sda % / /dev/sda % /var /dev/sda % /opt /dev/sda % /boot tmpfs % /dev/shm

16 Umount error [15:18:48]root@wiley ~ # umount /var umount: /var busy
Open file someplace in /var

17 du Show space used by individual files Default only shows directories
du -a shows files

18 File Types Symbol Meaning - Regular File d Directory l Symbolic Link b
Block Special File c Character Special File s Socket p Named Pipe

19 find Allows you to find a file in the file system structure
find ~ -name “*txt” –ls find /etc –name “*cons*” -ls

20 find arguments mtime – last modified time +1 = more than one day ago
-1 = less than one day ago size – size of file #[cwbkMG] type – type of file (see file types slide) ls – long listing, equivalent to ls -dils on each file


Download ppt "Users/Groups/Permissions"

Similar presentations


Ads by Google