 Today I wanted to show you a really neat tool that I know not everybody is going to find useful But I think it's pretty cool from a security standpoint for those of you that do work on machines and you drop to a TTY which is a virtual terminal a virtual console and Sometimes you have to leave that machine and you don't want anybody else to come to that machine Where you're already logged into this TTY as whatever user, you know You want to be able to lock of that virtual console down. Well, there's a program that can do this It's called V lock. So let me show you this program in action Let me switch over to this virtual machine of a boon to here and of course, we're in a graphical Environment, we're actually just gonna drop to a TTY in a second But since I had to log into the graphical environment, let's go ahead and sudo apt install V lock here in this terminal inside Ganon and V lock is the name of the package in Debian and a boon to base distributions V lock is also the name of the package Inside fedora. So you need to install V lock to get the V lock program on Arch Linux You need to install a package called KBD That is found in the core Repositories for Arch and once you install KBD, then you should have access to the V lock command So let me go ahead and switch to a TTY So I'm in vert manager here So I'm gonna go to the menu here for send key and I'm going to do control alt F3 And that gets me to TTY 3 here I'm gonna go ahead and log in as my home user, which is the DT user here Let me go ahead and scale the display. So hopefully you guys can read that a little better Make this full screen and the way V lock works out of the box is let me man V lock It has a few flags and options here So we have a dash a for lock all console sessions dash C to lock the current session Dash S to disable the sys RQ function and really those are about it I mean, there's a few other flags, but those flags I just mentioned are the most common so just V lock with nothing else No other flags is actually the V lock dash C command with the current command What this does is now this TTY the current TTY session we're in It's locked. You see it says press enter to unlock So what you would do is press enter and then it's gonna ask you for the user that was logged into this session His password. So let me enter DT's password and now it is unlocked But let me rerun the V lock command. So we've locked TTY 3 here And then let me get out of full screen. I'm gonna switch over to TTY 4 here with control alt F4 And you see I can log in just fine here, right? There's no lock here But if I go back to TTY 3, you know, it's still locked So V lock with no flags is just locking the current virtual console It doesn't lock them all so what you would want to do Let me go ahead and enter my password there What you want to do is do V lock space dash dash all or just a single dash and a and that locks all The virtual console sessions. You see you get a different message here It now specifically states the entire console display is now completely locked So if I go back to TTY 4, you see that session is locked Of course TTY 3 was also locked if I go to a new TTY TTY 5 even though I wasn't logged into it yet. It's locked as well So let me go ahead and enter my password and unlock everything But the command you probably will want to use with V lock as far as the flags and options I would recommend is the dash a flag for all I would also give it the dash s flag to disable the sys RQ key Which is sometimes called the magic sys RQ key, right? It's a key in Linux You guys if you have a full 110 keyboard, you probably see that weird key the sys RQ key What does that do? Well that key on Linux what that does is it allows you to perform various low-level commands Regardless of the system state. So if your computer is hung up, you know It's frozen or something the sys RQ command can allow you to still run some some commands some low-level commands Well, you you want to disable that function obviously if you're going to the trouble of locking out your virtual terminals You also want to disable that key and that's what V lock dash AS is going to do and now all the virtual terminals are disabled sys RQ is disabled until you hit enter and enter Your password so rather simple command. There's really not much to it And I know a lot of people are gonna wonder would they ever have a need for it, especially desktop Linux users I'm how often do you drop to a TTY and then want to lock out the session, you know That's mainly for I don't know system administrator types Probably would find V lock useful for those of you in graphical sessions. You're just a standard Linux desktop user How do you lock out your graphical session? Well, these are you know basic things you're probably already doing so Typically if you're not the only person that has access to your computer when you're done with your computer You should probably log out right just log out of your desktop environment or window manager If you're using a login manager then anybody else that wants to use that computer would have to log in with your user name and Password and if they don't have it obviously they can't use it if you want some other safety benefits Some safety features and most desktop environments such as Genome here There are settings for a timeout right you set a timeout for five ten fifteen minutes Meaning if nobody does anything at this computer for the next five minutes, you know The mouse keyboard are never touched then automatically Genome will lock the session meaning you're gonna have to enter the password of the user that was already in this session To get back in now a tool I like to use on my own system is a suckless tool called S lock So let me switch over to my main production machine So this is my main production machine running Arco Linux at ArchBase Linux distribution And there is a program that I have installed called S lock Let me zoom in here S lock again. It's a suckless utility All it does is when S lock gets executed you could set this to a key binding So anytime you're done with your computer you just hit a key binding to automatically run S lock and watch what happens The screen turns a solid color in this case black There's some configuration you could do with S lock, but it's a very simple tool the screen turns black And now I have to enter my password As I'm typing my password the screen turns blue letting me know hey, I'm typing and then when I hit enter It unlocks the screen now if I had typed a bad password Then when I hit enter the screen would have turned red to let me know wrong password Retiped the correct password and hit enter so that is S lock a very simple screen locking utility I did a video a while back on S lock So go check that out for more details about that particular application now before I go I need to thank a few special people I need to thank the producers of this episode and of course I'm talking about Devin Gabe James Matt Michael Mitchell Matt and Paul Scott West I got them all out of order Alan Chuck commander angry Dioca Dillon George Lee Linux Ninja Maxim Mike Erion Alexander peace archer for door Polytech Red Prophet Stephen Willie. I Missed that up, but hey, I want to thank each and every one of these guys. They're my highest tier patrons over I'm patreon because without these guys this episode you just watch would not have been possible The show is also brought to you by each and every one of these ladies and gentlemen as well all these names You're seeing on the screen right now These are all my supporters over on patreon because I don't have any corporate sponsors It's just me and you guys the community if you like my work And you want to see more videos on Linux and free and open source tools like V lock Please subscribe to distro tube over on patreon. All right guys. Peace. I Never bother locking my desktop. I use x-mo Ned. Good luck cracking that nut