/srv/irclogs.ubuntu.com/2009/04/10/#ubuntu-classroom.txt

bodhi_zazenAre we ready to start ?00:00
* Snova is here00:00
bodhi_zazenweee hooo00:00
* tim_sharitt is ready00:00
bodhi_zazenfirst, sorry about the confusion re time and date00:00
bodhi_zazenagain, I will do these Q&A sessions every 2 weeks or so00:01
bodhi_zazenI was asked to cover permissions today and to make it interesting will add in sticky bits and acl :)00:01
* RachedTN is ready too :)00:01
bodhi_zazenThis is a good time to mention the shared ssh session00:02
bodhi_zazenhttp://paste.ubuntu.com/147955/00:02
bodhi_zazenwe can use that for a hands on demo00:02
bodhi_zazenbut if you are interested , please ssh in when you get a chance00:02
bodhi_zazenso you are ready to go when we start00:02
* Geek`N`Proud thought he'd stick around00:02
Pretto40400:02
bodhi_zazenif you need help, ask and someone will answer in a PM00:02
Daisuke-IdoThe requested URL /beginners/ufbt-guest was not found on this server.00:02
bodhi_zazenhttp://paste.ubuntu.com/147955/00:03
WastePotatoAm I late?00:03
SnovaNo.00:03
WastePotatoOk.00:03
bodhi_zazenAh, my mistake, lol00:03
bodhi_zazenhttp://bodhizazen.net/ufbt/ufbt-guest00:03
* bodhi_zazen bad00:03
WastePotatoYay. SSHing into bodhi_zazen's computer. \o/00:04
bodhi_zazensweet :)00:04
SnovaOr as close to it as you'll ever get...00:04
bodhi_zazenOK, lets start with the basics00:04
bodhi_zazenpermissions often frustrate new users00:04
bodhi_zazenand it is a BIG change if you come from Windows00:05
Daisuke-Idoi'm going to pop back over to gnome00:05
bodhi_zazenEvery file and directory has an owner (the one who made it), a group, and "other"00:05
bodhi_zazenpermission are rwx - read, write, and execute00:05
bodhi_zazenand so are listed with ls -l00:05
bodhi_zazenas 3 sets :00:05
bodhi_zazenrwxrwxrwx00:06
bodhi_zazenfor owner:group:other00:06
bodhi_zazena - means you do not have the permission00:06
bodhi_zazenso r--r--r-- is read only00:06
bodhi_zazenYou can also see permissions graphically by right clicking a file00:07
bodhi_zazenand selecting the permissions tab00:07
bodhi_zazenTo change permissions from the command line you can use "octals"00:07
bodhi_zazenwhich are listed here : http://www.zzee.com/solutions/linux-permissions.shtml00:07
bodhi_zazenor if you can not use the octals, use +rwx00:08
bodhi_zazenso, with the chmod command00:08
bodhi_zazenchmod o+rwx foo00:08
bodhi_zazenchmod g+r foo00:08
bodhi_zazenchomd 755 foo00:08
bodhi_zazenyou change the group with chown or chgrp00:09
bodhi_zazenchown owner:group foo00:09
bodhi_zazenchown owner.group foo00:09
bodhi_zazenperiod works as well as a : , although it id depreciated >:)00:09
bodhi_zazenWith the gui tools use the pull down menu00:09
bodhi_zazenThe thing that is odd, directories00:10
bodhi_zazenyou need to set the x to list the contents of a directory00:10
bodhi_zazenchmod a+x bar00:10
bodhi_zazenallows people to ls bar00:10
bodhi_zazenagain see http://www.zzee.com/solutions/linux-permissions.shtml00:10
bodhi_zazenQuestions about basic permissions ?00:11
bodhi_zazenotherwise I am going to move on to sticky bits >:)00:11
bodhi_zazenSticky bits are not hard to understand, but they are odd00:12
bodhi_zazenThey are also called SUID and SGID00:12
bodhi_zazenif you have an executable file or binary00:12
bodhi_zazenand you suid it, it runs with the permissions of the OWNER of the file, not the user who runs the script / binary00:13
bodhi_zazenso ...00:13
bodhi_zazenif the file is owned by root00:13
bodhi_zazenand you then chmod 75500:13
bodhi_zazenanyone can run the file00:13
bodhi_zazenif you run the script as a use, the process has permissions of the user who called it00:14
bodhi_zazenIf, however, you chmod u+s foo00:14
bodhi_zazennow anyone can run the script and , as it is owned by root, it runs as if root called the script00:14
bodhi_zazenno password is required00:15
bodhi_zazendo no do this00:15
bodhi_zazenany script to be run by root should be owned by root and, IMO, called with sudo00:15
bodhi_zazensame thing applies to SGID00:15
bodhi_zazenif the SGID bit is set, the script runs with permissions of the group that owns the file00:15
bodhi_zazenwith me so far ?00:16
bodhi_zazenOne last bit, +t00:16
bodhi_zazen+t is the "sticky bit"00:16
SpreadsheetCan I talk?00:16
bodhi_zazenin the past it meant keep the script in memory00:16
bodhi_zazenSpreadsheet: yes00:16
bodhi_zazenanyone can break in at any time00:16
SpreadsheetOk, I have a question00:17
bodhi_zazenthis is an open session00:17
bodhi_zazenplease :)00:17
SpreadsheetThis is sorta related to the topic00:17
SpreadsheetSometimes i use chown, and it doesn't work00:17
SpreadsheetThen i use it a couple more times and it does work...00:17
SpreadsheetIs this a bug?00:17
pleia2:)00:17
bodhi_zazenYou can not chown a file or directory you do not own00:17
bodhi_zazenhey pleia2 :)00:17
Spreadsheetbodhi_zazen: All of the files on this comp belong to me...00:18
bodhi_zazenthis makes sense in that a user can not chown a file owned by root00:18
SpreadsheetOh wait00:18
Prettonever happened to me :D00:18
bodhi_zazenLMAO Spreadsheet00:18
SpreadsheetOk, the file is owned by root00:18
SpreadsheetSo then I use sudo00:18
bodhi_zazento change a file woned by root you need sudo00:18
bodhi_zazenbut you should not change ownership or permisssions of system files00:19
SpreadsheetIt's not a system file00:19
bodhi_zazensudo -e /etc/fstab for example00:19
Spreadsheet /var/www/00:19
bodhi_zazenyea, that *should* be owned by www-data00:19
Spreadsheetehh... go on00:19
bodhi_zazenso, add your user to www-data00:19
bodhi_zazen:)00:19
bodhi_zazenOK, we were talking sticky bits00:20
bodhi_zazenthe most common use of a sticky bit is on a directory00:20
bodhi_zazenif a sticky pit is set on a shared directory (one with say permissions of 777)00:20
bodhi_zazenusers can not delete file they do not own00:21
bodhi_zazeneven though group or other permissions may allow rw access to a file00:21
bodhi_zazenThere is a very nice review of sticy bits here : http://lokams.blogspot.com/2008/03/about-suid-sgid-and-sticky-bit.html00:21
bodhi_zazenand here : http://www.linuxdevcenter.com/pub/a/linux/lpt/22_06.html00:22
bodhi_zazenquestions ?00:22
bodhi_zazenOtherwise I am going to talk about acl , or access control lists00:22
bodhi_zazenPlease, all questions are welcome and it gets boring seeing a wall of bodhi.zazen speaking >:)00:23
SnovaMight want to go into setuid/setgid (though that'd be another wall :P)00:23
SnovaOh wait00:23
* Snova wasn't here00:23
SnovaWell, in that case, what does the sticky bit do on a file?00:23
bodhi_zazenlol Snova :)00:23
bodhi_zazenyou mean the -t on a file ?00:24
bodhi_zazenor the SUID00:24
SnovaSticky bit... no idea what "-t" means. :P00:24
bodhi_zazenlol00:24
bodhi_zazenSnova: take a look at this linky : http://lokams.blogspot.com/2008/03/about-suid-sgid-and-sticky-bit.html00:25
Spreadsheetg2g00:25
bodhi_zazenI covered the topic just previous and do not want to repeat it ;)00:25
bodhi_zazenOK , acl stands for access control list00:26
bodhi_zazenthe idea of an acl list comes into play when you have many, perhaps hundreds of users on a system00:26
bodhi_zazenand so then the "other" permissions get messy00:26
bodhi_zazenyou do not want to create hundreds of groups for all the various user shares00:27
bodhi_zazenenter acl00:27
bodhi_zazenacl allows a user to set permissions on a file or directory for each user on the system00:27
bodhi_zazenacl is the backbone of SELinux, and if you understand acl you understand a lot about SELinux00:28
bodhi_zazenacl is installed by default on Ubuntu, but you need to "activate" it00:28
bodhi_zazenit is an option when you mount a file system00:28
bodhi_zazenso you00:28
bodhi_zazenmount /dev/sdxy /media/foo -o acl00:29
bodhi_zazenOr add acl to /etc/fstab in the options column00:29
Prettoso, acl is just for "others" right?00:29
bodhi_zazenyes and no Pretto00:29
bodhi_zazenI will demo it in a sec ...00:29
bodhi_zazenacl is a command line tool00:30
bodhi_zazenalthough there is a very nice gui tool, Eiciel00:30
bodhi_zazenhttp://www.linux.com/feature/13816900:30
bodhi_zazenEiciel is in the Ubuntu repos , but I could not integrate it with Nautilus as in that link00:31
bodhi_zazenafter you install it it is in the menu under System00:31
bodhi_zazenwant to see acl in action ?00:31
* jgoguen nods00:31
Prettoyeap00:32
bodhi_zazenOK, everyone ssh into the shared session ?00:32
bodhi_zazenlet me show a few things ...00:32
bodhi_zazenOK, permissions of new files are govened by umask00:33
bodhi_zazenso as you can see , the group is govened by the primary or effective group00:33
bodhi_zazenNow lest change groups for a sec00:33
bodhi_zazenthe command was newgrp and it spawns a new shell00:34
Pretto:D00:34
bodhi_zazendo you see how that changed the group of the new file ?00:34
bodhi_zazenOK, so if I want a shared directory , I would now need to chmod all those files00:35
bodhi_zazenchomd -R 770 MAD00:35
bodhi_zazenor worse, chmod -R 777 MAD00:35
bodhi_zazenor chgrp and then chown, you get the idea00:36
bodhi_zazennow let us use ACL00:36
bodhi_zazenSee the +s in the permissions ?00:36
bodhi_zazenthe sgid is set00:36
bodhi_zazenDo you see how the sgid bit made the file "file.admin" owned by the group guru ?00:38
bodhi_zazen>:)00:38
bodhi_zazenOK, now acl ...00:38
bodhi_zazenYou list the access list with getfacl file00:38
bodhi_zazenwe set the acl with setfacl00:39
bodhi_zazenThis changed the behavior of the directory, we set the defaults with -d and the options with -m and long handed rwx permissions00:42
jgoguenbodhi_zazen: so the default ACL entries will override the existing user/group/other permissions?00:42
bodhi_zazenyes jgoguen00:42
bodhi_zazenwith that last command , I over rode the sgid we set00:43
bodhi_zazenthe directory is not owned by admin00:43
bodhi_zazendefault:group:admin:rwx00:43
bodhi_zazenwatch00:43
bodhi_zazenhmm ,not what I expcected, lol00:44
Prettohhehhehhe. .weird00:44
Prettoso the + means that MAD has an acl?00:45
bodhi_zazenyes Pretto00:46
bodhi_zazensee how acl changed the group of "file" made by root ?00:46
bodhi_zazenfrom root.root to root.guru ?00:46
bodhi_zazenOK, now lest add a user00:46
bodhi_zazensee, now I added in the user, bodhi, who has rwx to the file MAD/file.guru00:47
bodhi_zazenuser:bodhi:rwx00:48
bodhi_zazenand on00:48
bodhi_zazenObviously acl is a bit complex00:48
bodhi_zazenand I will not claim to be an expert00:48
bodhi_zazen:)00:48
bodhi_zazenoops, apparmor is preventing me from showing you more with acl at the moment00:49
bodhi_zazenlol00:49
bodhi_zazensee : http://www.suse.de/~agruen/acl/linux-acls/online/00:50
bodhi_zazenfor more info on acl00:50
bodhi_zazenand man acl00:50
bodhi_zazenand Eiciel00:50
bodhi_zazenEiciel gives you a gui tool to manage acl00:51
bodhi_zazenSorry if I rambled on too long about permissions00:51
bodhi_zazen:)00:51
bodhi_zazenwe have 10 min left00:51
bodhi_zazenquestions ?00:51
bodhi_zazenyou like the shared ssh session ?00:52
bodhi_zazenI can demo apparmor if you want :)00:53
bodhi_zazenSee how the /tmp directory has +t set ?00:54
bodhi_zazenyou should now know what that means :)00:54
bodhi_zazenyou should now understand why root kits search for files with the suid bit set00:55
jgoguenbodhi_zazen: back to setuid/setgid...should setgid necessarily be avoided the same as setuid?00:58
bodhi_zazenprobably jgoguen00:59
bodhi_zazenalthough it is not working as I expected00:59
bodhi_zazenif you need to run a script as root, use sudo01:00
bodhi_zazenIf you need to give a user limited root access, use sudo and configure with visudo >:)01:00
bodhi_zazenAh, apparmor is restricting me from further demos :)01:00
bodhi_zazenyou will have to check out suid on your own , lol01:01
jgoguenI was thinking more along the lines of having a script write to a log file...but I suppose ACL would also handle that quite nicely :)01:01
bodhi_zazenacl FTW :)01:01
bodhi_zazenOnce you learn acl , and you have a multiuser system, you will make good use of it01:02
bodhi_zazenacl does not make sense, however, on a single user system01:02
Prettothank you for your explanations bodhi_zazen01:03
bodhi_zazennp Pretto :)01:03
bodhi_zazenthank you for coming01:03
bodhi_zazenanyone have a suggestion for next time ?01:03
bodhi_zazenIn the long run, we will bring up a moodle site and content will be available for review pre and post sessions01:04
bodhi_zazenthe BT is working on it01:04
bodhi_zazenIf you have suggestions, add it here01:04
bodhi_zazenhttps://wiki.ubuntu.com/BeginnersTeam/FocusGroups/Education/Proposals01:05
bodhi_zazenthank you everyone for coming01:05
bodhi_zazenplease spread the word01:05
bodhi_zazenyou should all have been disconnected from the shared session as I closed it :)01:06
bodhi_zazensee you again in 2 weeks01:06
jgoguen\o/ ty bodhi_zazen01:06
bodhi_zazenyou are most welcome jgoguen01:06
bodhi_zazenI hope I learned you something01:06
WastePotatoI always miss it. ):01:08
DasEiermm, you're just done now ?01:08
WastePotato?01:08
WastePotatoI had a shower.01:09
DasEiroot@jaunty64:~# date -u01:09
DasEiFr 10. Apr 00:05:07 UTC 200901:09
DasEiroot@jaunty64:~#01:09
WastePotatoWut/01:09
DasEignarf...01:09
WastePotatoHey bodhi_zazen, what was that thing on your shell with the quote and and the calendar? I want it. o:01:10
WastePotatoDasEi: Oh I get it.01:13
DasEiI recently got a email saying friday, 00.00 utc.. two thirds of every meeting slip through the time-gap01:13
WastePotatoDaylight savings time, maybe?01:13
DasEiWastePotato: on a linux-trml? , lol; WastePotato01:14
WastePotatoHmm.01:14
DasEisad enough, and I even was on and checked time before-- lets all go home and cry then ;-)01:15
WastePotatoWait a sec.01:16
DasEisure01:16
DasEiany of the others, did someone log that seession ?01:17
WastePotatohttp://pastebin.com/f153ef8b5 ('pastebin - collaborative debugging tool')01:18
WastePotatoIt's the best I can do. ):01:18
WastePotatoDamn. I really need to sort out my log folder.01:18
DasEiWastePotato: very nice thank you, no I can rest in peace in again01:19
WastePotatoDasEi And all of the stuff that happened in his ssh session is here: http://pastebin.com/m1aa9b669 ('pastebin - collaborative debugging tool')01:20
DasEiso permissions, nothing completly new to me, though always nice to rexerise; funny, the date I got was european - one day01:23
DasEiWastePotato: did you want me to wait for the log or still something else ?01:24
WastePotatoEh?01:30
WastePotatoThe channel log and the ssh log are all that I have/01:32
WastePotatoDoes anyone want me to paste the log on the site?01:34
WastePotato!log01:34
ubot2Channel logs can be found at Channel logs can be found at http://irclogs.ubuntu.com/ - See also !OpenWeek - See also !OpenWeek01:34
WastePotato):01:34
DasEiWastePotato: that was very nice, I just refelcted your upper Wait a sec, gripping acl rightnow:)01:34
DasEireflected*01:34
WastePotatoOh. :)01:35
DasEiis there anyone around practising some ssh with me tomorrow/saturday..  whenever ?01:40
DasEienough to read and try myself for now, see you around and thanks again01:44
=== F4ilure is now known as Default_User
=== Andre123 is now known as AndreSTC
schwinn434looking for #ubuntuforums-beginners something like this, any help would be appreciated04:38
schwinn434can't get the exact chat room name correctly04:38
nhandlerschwinn434: It is #ubuntuforums-beginners, I don't know why it isn't working for you04:42
=== yamen_ is now known as Myamen
=== _Purple_ is now known as _Purple_away
=== cavalierski is now known as cav
=== _Purple_away is now known as _Purple_

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!