Make wget Use IPv4 or IPv6

Today’s article is a fun one, an article where you learn how to make wget use IPv4 or IPv6. Not only is this useful, it’s easy! In fact, it’s easy enough for most anyone to figure out. Plus, this will be a fairly short article – I think. I mean, I haven’t written it yet, but it seems like a short one.

I’ve done a couple wget articles, with the most recent showing you how to make wget ignore certificate errors. In fact, in that article I showed you how to enable that permanently. I’ll have to add that to this article. That’ll come in handy for like 0.01% of you.

If you don’t know, wget is a tool for downloading content from servers. These days, we use it to grab stuff from web servers without having to go through a browser – more often than not. Sometimes we use it to scrape entire sites without actually visiting them in a browser! (Sometimes, doing that makes you a dick.) It’s a handy tool for that sort of stuff.

Once in a while, while using wget, you’ll come across a finicky download that will throw an error about wanting IPv6 (or IPv4 if you’re using IPv6). That’s when this article is going to come in handy. Sometimes, a server isn’t configured for, or will refuse connections from, one or the other. That’s when you’ll see errors and that’s what we’ll resolve in this article.

Hmm… Do I need to explain wget more? Nah, y’all know what it is. IPv4 vs IPv6? Well, how about you check out this link to learn the difference and why it matters. That’s a good link. Alright, moving on…

Make wget use IPv4 or IPv6:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open. The wget command will throw an error, letting you know if you must use one or the other.

If you need to force IPv4, it’s nice and easy:

If you need to force IPv6, it’s also nice and easy:

If you find yourself doing this often, one way or the other, you can actually tell wget to do this on a permanent basis. Like in the previous wget article you can edit your .wgetrc file (create it if it doesn’t exist) to include either --prefer-family=IPv4 or --prefer-family=IPv6 and it’ll try one before trying the other if it’s available.

Closure:

See? Nice, neat, and simple. You’ve learned how to make wget use IPv4 or IPv6 – should you find yourself needing to do so. It’s a handy trick to have up your sleeve, ’cause you will eventually find a server that requires one or the other. Given enough use, it’s gonna happen.

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.

Disallow SSH Login For A Specific User

In today’s article, we’re going to learn how to disallow SSH login for a specific user. The reasons you might want to do this should be obvious, so that’ll save some time! Read on to learn how!

I’ve covered SSH in many articles. If you search for “SSH”, you’ll find a bunch of articles covering the subject. I’m not sure why there are so many, but there are. I seem to have a lot of notes on the subject. 

Here, this link will help you search for SSH articles.

SSH is “Secure Shell”, a method to login to remote computers so that you can manage them without being their physically. It’s used by systems administrators regularly, without ever needing a GUI to manage their Linux systems.

It’s also used by people like me, too lazy to walk to the other side of the room. I’m literally using SSH to manage stuff on my laptop from here on this desktop as I write this. On top of that, while not logged in right now, I was using SSH to manage a VPS earlier today.

So, SSH isn’t just for professional system administrators and, if you use SSH at home, you might as well know how to secure it. This article will help you secure your system – by learning how to disallow SSH login for a specific user.

Disallow SSH Login For A Specific User:

This article requires an open terminal on (and connection to) the computer you wish to change. That may require you to login to that computer remotely. If you’re on a local device and you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open. Otherwise, SSH into it like a boss.

With your terminal/connection now open, enter the following command:

Find a place to make a new line and enter the following with some care:

Now, this one is a bit picky. Obviously, you substitute <username> with the real name – but in between “DenyUsers” and the username you absolutely MUST press the TAB key. If you try to just use spaces, it will not work! You MUST use the TAB key which will appear to insert spaces for you!

Assuming you’ve done everything correctly, you’ll need to restart SSH for the changes to take effect. You can do that with this command:

If you were logged into a remote system to make the changes on that system, the above command is gonna log you out and you’ll need to login again. You knew that, but I figure I’ll mention it.

Hmm… If you’re a barbarian that doesn’t use systemd, try this:

When SSH restarts, the prohibited user will get a “Permission Denied” message when they try to login. Ha! That’ll teach Jerry in accounting from thinking he’s a system admin!

Closure:

Whelp… You have another article. This one has shown you how to disable SSH login for a specific user (Jerry in accounting, who had no business accessing the server anyhow). You’re welcome!

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.

Check Your SSH Server Configuration

Today, I’m going to show you how to check your SSH server configuration. It’s a simple process, but not one many people seem to know about. It’s also a pretty handy tool if you’re having SSH issues. Once again, this one isn’t all that complicated, I think… Read on!

So, why would you want to check your SSH server configuration?

Your SSH server might not be working. You may have made some changes and want to test it before moving it to production. An upgrade to the SSH application may have made some of the options different or even removed the options entirely.

There are all sorts of reasons why you’d want to check your SSH server configuration. Those are just a few of them. Not only will the article show you how to check your SSH configuration files – it’ll show you how to test alternative configurations. So, you can test your changes before making them – potentially saving you a physical trip to the server.

Check Your SSH Server Configuration:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

By the way, I would test/learn this on a local system. You’re potentially going to break things. In fact, let’s start by breaking them! Well, let’s create a backup first, and then we’ll break stuff.