How To: Create a New User Without a /home Directory

There are legit reasons to create a new user without a /home directory. Maybe you want a new user to have limited access to just a few things, or a dedicated user that runs a single application. This article will show you how.

See, I was reading a forum post on Linux.org about a member that had set up a bunch of Linux computers for some learning children. One of the things that came up was that the kids were already trying to guess the password so that they could install games. 

That got me thinking about some security implications. What if they guessed the password and wanted to hide it? What if they used that password to create a new user, but one without a /home directory so that it wouldn’t be easily spotted by just using a file manager? It wouldn’t be impossible to find, but it’d not stand out immediately with a quick inspection. Besides, the new account’s password would remain the same even if the admin changed the password to the root account.

Well, if they get that advanced and guess that password, I kinda hope they read this article! Why? Because the world needs a little chaos and creativity! So, my fellow Linux.org forum user, this article is for you! Well, no… It’s for when the kids use a search engine to learn how to make a user account a little less obvious! 

Create a New User Without /home:

This one will be short and easy, perfect for budding Linux users! There are two easy ways to create a user without automatically making a /home folder. 

Both ways are done in the terminal, so you need to open it. To open the default terminal, use your keyboard and press CTRL + ALT + T.

Now, the first method is:

The second method is:

Those commands will both make a new user without a /home directory of their own. (Be sure to check ‘man useradd’ for more awesome things you can do.)

There are a couple more steps you can take, if you want. First, there’s no password assigned to the user you just created. So, let’s assign a password to them.

Follow the prompts to type in the password twice and you’re done with that step.

Next, the newly created user isn’t a member of sudoers – meaning it has no administrative rights. That’s easily fixed with the following command:

That command will make the new user a member of the sudoers group. Meaning they have administrative rights over the system. They can install software, remove software, delete files, create files, or even update the entire system.

The admin can still discover the new user by listing the users or poking around in the logs. However, the user won’t stand out immediately. There won’t be any new user folder in /home, so one may not have any reason to look. Additionally, changing the root password won’t matter. You’ll have to do something about the user they created.

And that, kids, is how you get started hiding stuff after you’ve discovered the root password! Use that account for your nefarious activities! You’re welcome!

Closure:

Nah, there are legit reasons why you’d want a user without a home folder. You may want that user to only access a limited set of applications or whatever. A keen admin would likely notice this fairly rapidly, so it’s not a great long-term strategy for hiding your game installing.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Last Updated on July 2, 2021 by KGIII

Smash a button!
[Total: 2 Average: 5]
image_pdfimage_print

How To: Stop, Pause, and Resume Processes Running in Your Terminal

As you learn Linux, you’ll possibly find yourself using the terminal more often. You’ll run processes in the terminal because you need to or because you prefer to. This is how you stop, pause, and resume those processes running in your terminal.

There are any number of reasons why you’d need to do this. I’ll give you an example in the main part of the article, but there are all sorts of reasons to know and use this information. There are a few generic reasons to do so, of course.

First, you’d want to stop processes because you don’t just want them to keep running forever. That’s the easy one, though they’re all easy. Speaking of which, this article should be pretty short and easy.

Second, you’d possibly want to not stop but rather pause a running process because you expect to return to it. This is different than stopping the process. It’s very much like pausing a movie.

Third, obviously, will be resuming the above mentioned process. If you’ve paused a running process then it only makes sense to know how to resume said process. If you don’t intend to resume it, it doesn’t make much sense to pause it.

This article will explain how to do all three of these operations!

Stop, Pause & Resume Terminal Processes:

So, we’re going to need both a practice exercise and an open terminal. Let’s start by getting the terminal open by using your keyboard and pressing CTRL + ALT + T.

That should open your default terminal. Assuming it does open your terminal, I want you to run the following command:

Once started that command will keep running over and over again. I assume you don’t need to keep pinging forever, so you can stop it with CTRL + C. That’s it. Once you issue that command, the process will stop.

What if you don’t want to stop it – you just want to pause it for a little while? Well, run the ping command again and this time use CTRL + Z. When you issue that key combination, the running process will pause and be pushed into the background.

If you want to resume running that process in the terminal, in that same terminal, you just use the following command:

Unlike the first two, it’s text that you enter into the terminal before you press enter. There’s no CTRL + anything that you use. You just literally type ‘fg’ (think foreground) and press enter. That brings the paused process back into the foreground and resumes running it.

The above commands, when run in succession, should look a little something like this:

terminal
It should look a little something like that. Those are the commands from above.

You can do this with all sorts of applications that run in the terminal. You can stop, pause, or resume, as needed by moving the running process into the background and then bringing it back into the foreground.

If you look carefully at the above image, you’ll see that it counted five packets as being transferred. This indicates that the process doesn’t keep running in the background. It’s truly paused. Typing ‘fg’ and pressing return brought the process back to the foreground, where it continued pinging this site.

Closure:

There you have it. It’s another article in the books! This one tells you how to start, pause, and resume processes running in a terminal. Hopefully, you can find some use for it. If you have any ideas for articles, feel free to leave a comment. My publication schedule seems to be working, so you can expect another article every other day.

Thanks for reading! Your readership and feedback helps keep me motivated! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Smash a button!
[Total: 1 Average: 5]
image_pdfimage_print

Let’s Learn How To Change The Default Terminal

There are many reasons why you may want to change your default terminal emulator. It’s actually nice easy to change the default terminal. This article explains how and anyone should be able to do it, even a beginner!

First, it’s often called a terminal emulator because it allows you to emulate the terminal in a graphical environment. There are other ways to refer to it, but just calling it the terminal is usually enough for all but the most pedantic. We’ll mostly just call it the terminal from here on out.

The people who put your distro together also picked the default terminal. It’s usually a basic terminal, and often just a terminal that has been around for a long time. That’s not a bad thing, but there may be better terminals than the default. There are terminals with all sorts of features, from multi-window terminals to terminals that support drag-and-drop!

Perhaps you might like XFCE-terminal, or you may prefer Terminator? Maybe you’d like Guake or TildeThe choices for new terminals are vast, and Wikipedia has a ton of them listed.

You can find even more by using your favorite search engine and searching for Linux terminals. Someone is always writing a new terminal and you can pick a new one to be your default terminal any time you want. There’s bound to be one out there ticks all your boxes.

If you want to open your default terminal, you can usually use your keyboard. Just press CTRL + ALT + T and it should open your terminal. If you don’t like the default, you can make any other terminal your default.

Change the Default Terminal:

For the purpose of this exercise, we’ll start with assuming you’re using Ubuntu and that you want to install Terminator and then set Terminator as the new default. However, aside from the initial installation command, it should work for other distros just fine. In fact, the installation command will work for most any distro that uses the apt package manager.

So, seeing as you opened the terminal up above, we’ll just skip right ahead to installing our example, Terminator:

Go ahead and let it finish the installation after you enter your password and agree to install it. Terminator should be in your default repositories and easily installed. This is true even if you’re not using Ubuntu or an Ubuntu derivative.

Once you’ve done that, you will need to set Terminator as the new default. To do that, run this command:

That should bring up some information that looks a little like this:

change default terminal emulator

From there you just pick the number of the terminal emulator you’d like to be the new default and press enter. That’s it. That’s all you should need to do.

You can test this by simply using your keyboard to open the default terminal like you did in the first section of this article. Once you’ve made the change, it should take effect immediately and the new default terminal should open up when you next open the terminal with the keyboard. You’ll still have the old links to the original default, but you can move those around at your leisure.

Closure:

And there you have it. That’s how you change your default terminal emulator. It’s not terribly difficult but it’s a quick and easy step you can take to make your Linux a little more customized, a little more something of your own. If you have any ideas for articles, feel free to leave a comment suggesting them. We’ll see what we can do!

Thanks for reading! It’s truly appreciated and there have been a lot of readers lately. If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Smash a button!
[Total: 3 Average: 5]
image_pdfimage_print

What You Need To Know About Linux’s Magic SysRq Key

The magic SysRq key can help you deal with a frozen and unresponsive system. It avoids doing a hard reboot along with, hopefully, avoiding potential loss of data. The SysRq key is actually a handy bit of knowledge to keep handy.

NOTE: The information in this article is for those who use the QWERTY keyboard. If you use Dvorak, AZERTY, etc., be sure to click the link in the opening paragraph because it will be different for you.

There are times when your system appears frozen but it actually isn’t. You can test this situation with the Shift Lock key. If the light (assuming you have one) comes on, the system isn’t technically frozen – it’s probably just not accepting inputs. But, if it’s so far gone that the light doesn’t change then it’s possible that this will not work.

There are all sorts of reasons why your system may appear to have halted. This article has nothing to do with that, nor is it about preventing a frozen session. It’s about using the magic SysRq key to get out of a situation where your system has stopped responding. 

The purpose, at least as far as this article is concerned, is to reboot without corrupting your data. This gives you a tidier reboot that reduces the risk of data loss. It’s quick and easy to learn and memorize.

The SysRq Key:

Look at your keyboard. Look carefully. The key we’re looking for is the ‘SysRq‘ key. You may not know why it is there, and may think it has no purpose, but it’s there and there for a reason.

The key is often doubled with the PrtScr (print screen) and doesn’t get used often. It’s used in combination with the Alt. If you’re using a keyboard with an Fn, you don’t normally need to use it to perform this keyboard function. Look around your keyboard and you should find the SysRq key. It’s bound to be there somewhere!

What you’re going to learn and is ‘REISUB’. This is easy to remember, because it’s ‘BUSIER’ backwards. When your computer is no longer responding, press (and hold) Alt, while holding SysRq, and then press R E I S U B in order shut everything down properly and reboot without (or with less chance of) data loss.

You can try it right now. However, you’re going to reboot if you do so. Leave about a second between each keypress.

You don’t actually need to use all the letters. If you give zero poops about data loss, you can go straight to Alt + SysRq + B. But, that’s not giving the system the chance to perform all the shutdown processes.

If you want to (hopefully) not lose data, use REISUB. This is what those letters do:

R puts keyboard in raw mode.
E sends SIGTERM (except init).
I sends SIGKILL (except init).
S syncs mounted filesystems.
U (read-only) remount of mounted filesystems.
B reboots the system immediately.

Those should reboot the system for you, after sending all the other commands. Again, it’s easily remembered as being ‘BUSIER’ backwards and you should press them immediately after one another, allowing a second between each.

Closure:

This makes yet another article in the books, and now you know how to reboot your system when it is frozen. The magic SysRq key works well enough, even though there are some situations where it won’t work. A computer can be so frozen that it’s no longer accepting any input at all. It works well up until you’ve reached that point.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Smash a button!
[Total: 2 Average: 4.5]
image_pdfimage_print

Screenfetch vs. Neofetch, You Decide!

Should you use screenFetch or Neofetch? That’s up to you to decide. This article will share some info about both of them. This should be a pretty short article.

I also confess that there’s not much of a “vs.” here. The screenFetch app hasn’t been updated in a long time and Neofetch is the clear winner for most folks. But, well, it seems like people have forgotten that screenfetch exists and that it existed well before neofetch was conceived. That’s why I’ve picked ‘History’ as one of the categories.

See, the thing is, screenfetch (I’m tired of capitalizing the F, and the N, just to be right!) still exists and still works just fine. In some cases, you might get the wrong information from it, especially with newer distros, so why use it? Well, you use it because it shouldn’t be forgotten – and ’cause it still works most of the time.

So, you decide… Screenfetch or neofetch? Or maybe both?

Screenfetch:

The screenfetch application was was created to gather system information so that it could be presented in a screenshot format. In fact, their GitHub page clearly states the purpose as:

Fetches system/theme information in terminal for Linux desktop screenshots.

Though it’s old, it’ll almost certainly be available in your default repositories. Just because it’s old doesn’t mean it isn’t still useful! (Perhaps I’m having some sort of crisis, ’cause I too am old and part of the purpose of this site is to be useful!)

Assuming you’re using a distro with apt, it’s a mere install command away:

Then, well, you use it. You could just run it with ‘screenfetch’, but you can also actually use the -s switch and create a screenshot of your full screen, making it easy to take and share a picture of your desktop to show others in forums and social media sites.

This is an edited down screenshot, ’cause the rest of my desktop isn’t all that interesting right now.

screenfetch
See? Screenfetch in action. I like the ASCII art better, actually. That’s a matter of taste.

As you can see, that was with the -s switch. It happily generates a screenshot of the entire screen, but I edited it down to just the terminal. There’s nothing interesting on my screen right now. Just a bunch of open windows, largely with text in them.

Screenfetch still works, and I like the ASCII art better. I suppose I could probably customize neofetch to make it do the same thing, but I’m way too lazy for that. Either way, it works – and it works just fine. It still does the task it was designed to do, even without any recent updates.

Neofetch:

Neofetch is newer and probably better in every single way. (Though I do have some issues with it on some systems, as it won’t create its own screenshot! That’s a ‘me’ thing, I suspect.) It’s also familiar to many people, and indeed has been mentioned on this site multiple times.

It gets regular updates and has a ton of options. It’s also able to be highly customized. In pretty much every single way, it’s the superior solution. It’s described by the authors like so:

The overall purpose of Neofetch is to be used in screen-shots of your system. Neofetch shows the information other people want to see. There are other tools available for proper system statistic/diagnostics.

It’s a much newer application. Screenfetch last had a release in 2019, while neofetch had a release just last August (at the time of writing). It should be noted that there have been some commits at the screenfetch repository, but they’ve not yet been released. The project isn’t dead. It just isn’t as active as neofetch.

Again, it’s easy to install. It’s in the default repositories for most any distro out there, at least the major ones. There are some distros that include it by default, including Lubuntu! Again, assuming you’re using a distro with the apt package manager, it’s installed just like screenfetch:

And, like screenfetch, you can just run it as ‘neofetch’. However, check the man page for it and you’ll see there are a ton of other options. It’s seriously highly configurable. It looks like this:

neofetch in action
This looks a lot like screenfetch, doesn’t it? The art is different. The output is also different!

For whatever reason, on that system the neofetch doesn’t seem to want to take a screenshot. I’m probably missing scrot or something like that. I’m too lazy to figure it out, but it’ll likely work just fine on your system. It’s a great way to gather a bunch of presentable information about your system, with the end goal being to show it to other people.

So, is neofetch the one for you? Is it really any better?

Screenfetch or Neofetch:

Sure, there hasn’t been a screenfetch release in a long time – but there’s sure to be one eventually. There’s activity in the repository at GitHub. That’s usually an indicator that there’s still more to come. I wouldn’t count it out and it’s pretty much feature complete.

Neofetch? Well, it’s much newer and has more consistent releases lately. It’s also highly configurable. You’ll be able to customize it all you want. You’re encouraged to edit ~/.config/neofetch/config all you want, making neofetch your own. It’s also a mature application, with a large install base and likely also feature complete.

Either one works. They do spit out different information. If you examine both screenshots above, you’ll see the data output is different. Not gonna lie, I ain’t gotta clue why they’re different. The areas where they’re different are trivial and I’ve made no effort to find out which is correct. 

What? It’s a blog. I have finite time for these things, you know! 😊

You can decide between screenfetch or neofetch – or you can use both. They’re both very similar and neither should be used for anything all that serious. They spit out some system information in a form that’s convenient for screenshots so that you can show off your system to your forum friends.

Closure:

Here’s another article in the books. It’s not really about a ‘vs’ anything, but the title seemed appropriate. It’s a good time to expose some of the newer Linux users to the venerable screenfetch tool, as choice is always a good thing.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

Smash a button!
[Total: 1 Average: 5]
image_pdfimage_print