How To: Enable Password-less SUDO.

This isn’t the smartest thing you can do. In fact, you probably shouldn’t do this. But, if you are comfortable with your physical security, you can use sudo without a password.

In my case, there’s not a whole lot folks are going to do with sudo on my computer. Anyone with physical access to my device is someone that I trust. I also run a ton of commands when hanging out in the support sites and I am frankly just tired of typing my password when I use sudo.

So, let’s get rid of it. Start by pressing CTRL + ALT + T, and then enter:

[code]sudo nano /etc/sudoers[/code]

Scroll down to the bottom and add this line:

[code]<your_username>  ALL=(ALL) NOPASSWD:ALL[/code]

Where “<your_username>” substitute it with your actual username on your computer. Now save it with:

CTRL + X

Y

ENTER

See that? You also may have just learned how use ‘nano’ to edit and save a text file while in the terminal. Pretty neat, huh? Anyhow, scroll up a little and look to the right. There’s a spot where you can enter a name and email address. If you do that (and confirm the email address) then you’ll get handy notices in the email when there’s a new article. I promise, I won’t send you a single non-site related email – ever.




Change the sort-order in Lubuntu Quick Launch

Lubuntu has gone from LXDE to LXQt. In LXQt there’s no way to drag the icons in the quick launch to sort them to your liking. Fear not, you can still sort them.

This one is actually pretty easy, you just have to know where to look.

Edit: Press and hold CTRL and then you can drag and drop them…

Navigate to ~/.config/lxqt/ and open ‘panel.conf’ with your favorite text editor. Scroll down until you see:

[quicklaunch]

You’ll then see your quick-launch applications on their own line and they’ll have a numeric value. That numeric value is how you sort them. 

For example, mine looks like this:

[code]apps\1\desktop=/usr/share/applications/pcmanfm-qt.desktop
apps\2\desktop=/usr/share/applications/xfce4-terminal.desktop
apps\3\desktop=/usr/share/applications/filezilla.desktop
apps\4\desktop=/usr/share/applications/chromium-browser.desktop
apps\5\desktop=/usr/share/applications/thunderbird.desktop
apps\6\desktop=/usr/share/applications/google-chrome.desktop[/code]

In the ‘apps\1\desktop’ there is a 1. That translates to the furthest right icon in the quick launch area of the taskbar. If I wanted it to be on the furthest left, I’d change the 1 to a 6 and then change something else to be 1. It’s pretty straightforward. I was pleasantly surprised when I was able to find that section. Why we can’t just drag them around like we could on LXDE is another matter entirely.

As always, scroll on up and subscribe to get notifications when I publish something new. Or not… It’s up to you! Who the heck am I to be shouting out orders anyhow?!?




How To: Enable Root User In Ubuntu

This article is just a really simple article. In it, I’m going to tell you how to enable the root account in Ubuntu (and related derivatives) by assigning a password to the account. 

First, if I may, I’d like to express some displeasures.

If you were to go ask this question on a number of sites, the people there would treat you as though you were a leper or a child. They’ll respond with things like, “You don’t need to use the root account, that’s what sudo is for.” Then, they’ll helpfully link you to a long-winded explanation of why using sudo is better.

Truth be told, they’re correct. They’re right. You shouldn’t be using the root account when it can be avoided – and it can pretty much always be avoided.

But, it demonstrates one of my pet peeves. See, they didn’t answer the question. It doesn’t matter that doing so may cause you untold horrors. What matters is that you asked a question and they opted to not answer you. It shouldn’t matter to them that you’re gonna do something stupid. What should matter to  them is giving you the answer to your damned question!

So, when someone asks me how to enable the root account – I tell them. Of course, I also mention that doing so is absolutely a bad idea, but I actually answer the question. This applies to other questions. If you ask a question, I do my best to answer it – if I am indeed taking the time to answer it. Maybe you just want to know how to do something? Maybe you have a good reason for it? It doesn’t matter to me, I answer the question to the best of my ability. Included in that is the appropriate warning, but I at least answer the question.

Linux is about freedom, and that freedom should include doing things that go against the grain. That freedom should include doing things like hosing your operating system. That freedom should include doing the ‘wrong’ things and doing them the ‘wrong’ way. 

So, keep that in mind when you’re answering questions – and not just this specific question. The person asking the question should get a real answer to their question, even if they’re asking the wrong question. If you can see it’s an X-Y problem, ask them for more information – but don’t be snide or aloof. If you’re not going to answer the question, just click that X in the upper right corner and close the tab. Sure, give them a warning – but also give them an answer.

So, on that note, here’s how you enable the root account in Ubuntu and distros derived from Ubuntu.

CTRL + ALT + T to open your terminal and enter:

[code]sudo passwd root[/code]

Now, don’t get confused, it’s going to ask you for your password. Enter that, your normal account password, and press the enter button.

Next, it’s going to ask you to enter your new password for root. So, type that in and press enter. Then, it’s going to ask you to type that same password again, and again you’ll press enter when you’re done.

That’s it. Root is now enabled and you could login as root via TTY (this does not allow you to login as root via the GUI login during boot, that’s for a different article) or whatnot. You just probably shouldn’t. See, root has access to everything. It’s a security risk and it’s increasing the likelihood that you’ll irrevocably ruin your operating system when you fat-finger a command. Seriously, don’t do this. It’s just a bad idea and you can easily use ‘sudo’.

Like always, thanks for reading. Look to the right sidebar and enter a name and email address. That way, you’ll know when I publish something! You want to know that, don’t you?




Use .htaccess to Stop People From Viewing Files in a Directory.

Open the directory with your favorite FTP client – unless you’re local and can just navigate to the directory.

Add a file called .htaccess. The ‘.’ is important and mandatory.

The permissions for .htaccess should be 644.

Edit the .htaccess file with a plain-text editor (don’t use a word-processor application) and add the following line:

[code]Options -Indexes[/code]

Save the file.

What this will do is prevent indexing the files in the folder. If people try to access the folder directly, they’ll get a 403 forbidden error.

At the same time, you can still link directly to files in that folder.

So, let’s say you added the .htaccess to a directory called /tmp. You can still link to, use, and send people to /tmp/picture.jpg like normal, but people won’t be able to browse the directory and find files you don’t want them to see.

For more information,  click this.




XF86Mail, Thunderbird, and OpenBox.

My email button on my keyboard didn’t work. It has never worked. I decided to make the keyboard email button open Thunderbird.

This is done in Lubuntu 18.04, but I presume it’s going to work in any Linux that uses OpenBox. It should also work with any ‘standard’ keyboard that has a dedicated email button. First, you should set Thunderbird (or whatever client) as the default email handler. I’m sure this will work with any Linux email client.

Try as I might, the “Setup Hot Keys” GUI method would not take. You’re really not supposed to edit the XML file that stores OpenBox configs. In fact, there’s a rather explicit warning stating that you should not do this. 

Depending on your distro, your OpenBox config may be called something else. In Lubuntu 18.04 it is in ~/.config/openbox/lubuntu-rc.xml – so use that as a guide to find your own.

Then, make a backup of the file and open it up with a plain text editor and add this:

<!-- Keybinding for email button-->
<keybind key="XF86Mail">
<action name="Execute">
<command>lxsession-default email</command>
</action>
</keybind>

Save the file, overwriting the original, logout and login again, now test it. I doubt it really matters where you put it in the file, but I tucked it in with the other keybindings. That will open your default email client. In my case, that is Thunderbird. Whatever you’ve registered as the default email client is what will open.