----BEGIN CLASS---- [14:00] #startclass [14:00] Roll Call [14:00] Jason Braganza [14:00] shivam soni [14:01] kiyo [14:02] cozy session today. only the three of us :) [14:02] https://lym.readthedocs.io/en/latest/users.html [14:02] saransh [14:02] https://lym.readthedocs.io/en/latest/files.html [14:03] ok kiyo shivam specbeck [14:03] please go through the two links i’ve shared up [14:03] and we meet back here in 10mins [14:03] ok [14:03] please ping me if you are done earlier and have questions [14:03] Roger that [14:13] done [14:13] almost time anyhoo. [14:13] specbeck, shivam done? [14:14] while we wait for them, kiyo any questions? any clarity needed? [14:14] I'm a slowpoke :) [14:14] the /etc/passwd file [14:15] Each line has seven entries separated by : [14:15] specbeck, take your time [14:15] username:password:uid:gid:gecos:/home/dirname:shell [14:15] root user has: root:x:0:0:root:/root:/bin/bash [14:16] x is the password? I guess its not literally 'x' but something else [14:16] yea. [14:16] it’s just a placeholder [14:16] it used to originally be there in more innocent times :) [14:16] no longer. [14:17] lol [14:17] oops [14:17] ! [14:17] the /etc/shadow file now has them in encrypted form [14:18] Can we actually access the passwords somehow? [14:19] specbeck, yes, but i don’t remember how [14:19] Oh :P [14:20] i never really researched how to, because as an old sysadmin, i’d rather just reset someone’s password when they forget it. [14:21] ! [14:21] specbeck, some incantations like this https://unix.stackexchange.com/questions/21705/how-to-check-password-with-linux [14:21] specbeck: as jasonbraganza wrote, they are in /etc/shadow. That's however readible by root only, and they are stored in encrypted form. You can try `man 5 shadow` to read more about that [14:21] next [14:21] what happens if give a number more then 7 while calculating file permissions. [14:22] shivam, try it. have not done that in a long time :) [14:22] should error out mostlyi [14:22] drwxrwxr-x. 2 fedora fedora 4096 Jun 24 08:00 dir1 [14:22] mostly [14:23] what is 2 and 4096 in above line? [14:23] ooh i don’t know what the two is . [14:23] but the 4096 is the file size [14:23] let me go look up what ls output is like :) [14:24] aah links [14:24] shivam, there are two links to that file. [14:24] next [14:24] Does every user has its own root user or the root user is the only super user? [14:24] okay, got it thanks. [14:25] specbeck, single root user :) [14:25] we have time, so ya’ll can throw all sorts of questions here today :) [14:26] Then why am I prompted to enter the su passwd for the user I'm using whenever I use sudo? [14:27] specbeck, that is a sudo feature [14:27] rather than have you leak the root password all over the place [14:27] Which is apparently different from the root user passwd and I have forgotten it :D [14:27] jasonbraganza, Oh I see... [14:27] sudo will only let users who are part of the group wheel carry out admin level commands [14:28] so when you do an sudo something [14:28] it checks for your password. [14:28] and since you are part of the wheel group, you have root level access [14:28] a good feature of sudo is that we can define, which user get root access to which programs [14:29] for e.g. while the default is root level access to everything, i could restrict access and say speckbeck has access as sudo admin only to hmm let’s say vi and ls. [14:29] if you sudo any command othere than those [14:29] it will not work [14:29] next [14:30] more questions? [14:30] Okay, so we can term them as partial super users then [14:31] yes :) [14:31] ;) [14:31] But that too depends on the root user, so root user is the SUPER USER \o/ [14:32] jasonbraganza, thanks got it :) [14:33] questions on file permissions? [14:33] while i wait, here’s one way i use group permissions. [14:34] the plex user on the pi has full access to the plex folder. [14:34] the pi == my raspberry pi, which i use for stremaing video [14:34] but i login to the machine using jess as the login [14:35] so earlier i used to copy to my folder. then change permissions to plex and then move them to the media folder [14:36] now i just added jess to the plex group. and did something called a setgid bit on the media folder. (look that part up) [14:37] no i can just scp using the jess user straight to the plex media folder without any permission or copy/move hassles :) [14:37] end of story :) [14:37] more questions people? [14:38] if not, let’s do processes [14:38] https://lym.readthedocs.io/en/latest/processes.html [14:38] This is from the earlier chapters, what does the less command do exactly? [14:38] ! [14:38] specbeck, less is something called a pager [14:39] specbeck, if you have something that takes more than a screen of space [14:39] then the screen will just scroll up yes? [14:40] yes [14:40] so we pipe the output with the | into the less command [14:40] which then gives us the output screen by screes [14:40] try it :) [14:40] next [14:41] shivam, kiyo, specbeck read https://lym.readthedocs.io/en/latest/processes.html and we regroup in 5m for questions :) [14:41] its ok I withdraw my request! [14:41] okay [14:43] kiyo, why woudl you withdraw? XD [14:43] ask away :) [14:46] ok are we back? [14:47] yes [14:47] kiyo, questions? [14:47] ! [14:47] next [14:48] so I have kde's system monitor running. is there things top and htop can do that my tool cannot? [14:49] kiyo, not really :) [14:49] kiyo, these are command line tools for when you have no gui :) [14:50] fair enough, sometimes there are magic methds in the cli tools :) [14:50] kiyo, that i leave to you to explore and teach me :) [14:50] processes, any question about processes? [14:51] yes, i donot have any question in this chapter. [14:51] the ls tools - lscpu or lsblk look at stuff in proc and give us details [14:52] and like the chapter says we can just go look at proc itself to get answers :) [14:53] the chapter has a sysctl example that modifies proc/sys settings to enable ip forwarding [14:53] i recently had to use sysctl to fix errors that i was getting when syncing files with syncthing [14:54] i have close to 100 gb of files tha sync between 3-5 computers [14:55] syncthing takes a folder, and then syncs its contents to other computers that you install syncthing one and link up [14:55] sort of like a self hosted dropbox [14:55] ! [14:55] the filesystem watcher on linux a limit of 8192 watches [14:56] so when synchthing did a large number of file changes, the system would get overwhelmed and cause errors or slow down [14:57] so i used sysctl to increase the watch limits to 204800 and tada! [14:57] problem resolved [14:57] obviously i was no Sherlock Holmes. i just read the documentation like a good boy :) - https://docs.syncthing.net/users/faq.html#inotify-limits [14:58] but yea, a good illustration of tuning system variables to match our needs :) [14:58] next [14:59] Do you have a tutorial for syncing files? I do this manually I wonder if some methods exist [15:00] kiyo, depends on the scenario. what do you do? or rather what do you face? a folder full of files that have to be kept in sync across two or more computers? [15:01] yes mostly just a large folder sitting on a ext hard drive and the same file structure sitting on my desktop [15:01] if that is the case, use syncthing. the documentation is excellent. the program is rock solid stable. - https://syncthing.net/ [15:01] aah so this is on the same machine [15:01] not different ones [15:01] if i make changes i want to sync it properlly with rsync or something [15:01] in that case i would just setup a cron job, that would rsync every 5-10 minutes. [15:02] i'm lazy so i just delete and copy [15:02] kiyo, yes. first just figure out the rsync command that you will use. [15:02] then stuff it into a cronjob [15:02] that should do the trick for you [15:02] ok thanks [15:03] specbeck, shivam questions? [15:03] ok let’s call it a night then. :) [15:03] we meet next on friday :) [15:03] no wednesday? ----END CLASS----