How To: Show An SSH Banner

Today’s article is another SSH article, and it will show you how to show an SSH banner. What’s an SSH banner? It’s a message shown when someone logs into the computer via SSH. This can include warning messages, reminders that they’re being logged, etc…

Why would you want to do this? Well, you can include specific directions in there. You can also do so for regulatory compliance, should you be obligated to warn people that you’re storing their information. Some of the messages are quite formal, but you can write your own.

Once again, SSH stands for ‘Secure Shell’. It’s a way to remotely login and use a remote device. It’s usually done in pure text, terminal mode. You can actually forward x11 and control some graphical applications. That’s easy enough and quite a load of fun.

I’ve actually written many SSH articles. Feel free to peruse them at your leisure. If you have questions about SSH, odds are good that I’ve covered them already. I think SSH is a brilliant tool and so quite a few articles cover the many things you can do with SSH.

I find SSH to be a useful, brilliant tool even when it’s just me in my house. As I also manage some remote stuff and SSH beats flying across the world just to update a computer. The good news is that I’ll eventually run out of SSH article ideas!

With the above in mind, let’s just jump into the article…

Show An SSH Banner:

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.

Note: We’ll be using ‘nano‘ in this article. Click that link to learn more.

With your terminal now open, it’s time to set up an SSH banner. To start with, we’ll create the banner. You’ll need to start with creating a file like so:

With your banner file open (and you can name it anything, or you can even place it anywhere), just enter the text you want people to see when they login via SSH. You can make it anything you want, but I tend to keep it brief. Some folks go for the giant ASCII banner types, but I like to keep it simple.

When you’re done writing your banner, you need to save it. To save it in nano, you just press CTRL + X, then Y, and then ENTER.

Now, you need to edit your SSH configuration. To do that you use:

Scroll down until you see the following:

Edit that line to read:

If you stored your banner in a different location or a different file name, you must also change the path to suit. Then, save your SSH configuration by pressing CTRL + X, then Y, and then ENTER.

Your next step will be to restart SSH. That command is nice and simple:

Next, login again with SSH and you should see your new SSH banner! It’s really that simple. If you don’t see it, make sure to double check because all those steps are necessary.

Closure:

And there you have it. You have another article! This one has shown you how to show an SSH banner. It’s not terribly difficult. It’s also potentially useful. Users are effectively agreeing to the terms you set in them, which may be legally binding. Enjoy your new SSH banner and, if it’s not in a professional setting, feel free to be creative with it!

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.

Use Your Hostname With SSH Instead Of Your IP Address – In Ubuntu

Today’s article will show you how to use your hostname with SSH instead of your IP address. This should actually be a very short article, like really short. We’re only using Ubuntu for this example, because it consistently uses the .local for your hostname. This will work with any distro that does that.

If you don’t know what SSH is, it’s ‘Secure Shell’ and is a way of connecting to remote computers. I’ve written many articles about SSH. Go ahead. Click that link and have a browse around. This will be a short article because I’ve already written a good amount of material. I’m trusting you to search for things you don’t already know.

You’re also going to need to know your hostname. To do that, read this article:

What is my Hostname in Linux?

You’ll need that hostname information because that’s how you’ll be using your hostname with SSH. I’m going to assume you already know the IP address, because that’s what you’d have been using for SSH instead of using your host name this entire time.

With all that in mind, let’s just get to it…

Use Your Hostname With SSH:

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.

Now, again, I’m going to assume you know the IP address and that’s how you’ve been connecting to the device with SSH. I’m going to assume that you read the above link, learning how to find your hostname.

So, with that in mind, login to your remote Ubuntu (or official Ubuntu flavors) computer using your IP address. Next, find your hostname. You can just use the hostname command, to make it easier.

Now that you have your hostname, add .local to it. This works because it’s on your local network. If you had a VPS somewhere, you’d just use the FQDN (like example.com) to connect. Then, with that hostname information in hand, exit your SSH session with exit and try logging in with the hostname.

So, if your computer was called ‘mydevice’ you would connect to it with:

That’s it. Just put your hostname in front of .local and you should be able to use your hostname with SSH. This will work for other distros, of course. However, I’ve only verified it with official Ubuntu flavors. So, that’s the caveat should you try this with other distros.

Closure:

See? I told you that this would be a short article. It really doesn’t need to be longer and I’ve padded it more than enough. Seriously, this one could have been so much shorter!

This site could really use a better author and an editor! Alas, you get what you get and that’s just me at the moment. Do feel free to offer to help. I have thought about doing more of these fairly short articles, as there are some great subjects that really don’t need an 800+ word article.

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.

Make A Website Screenshot With CutyCapt

In today’s article, we’re going to use the terminal and make a website screenshot with CutyCapt. It’ll be a short and easily followed article, but one for everyone to follow. Even a rank beginner will easily be able to make a website screenshot with CutyCapt! (That’s the link to the project homepage, or where you need to go to learn more about CutyCapt.)

There are pretty much a zillion screenshot tools. There are even a metric-ton of browser extensions that specialize in taking a website screenshot. You can use any of those, or you can just install CutyCapt and use that from the terminal. There are even multiple choices when it comes to taking website screenshots from within the terminal, but  we’ll just be using this CutyCapt in this article.

If you’re curious, CutyCapt defines itself on SourceForge as:

CutyCapt is a small cross-platform command-line utility to capture WebKit’s rendering of a web page into a variety of vector and bitmap formats, including SVG, PDF, PS, PNG, JPEG, TIFF, GIF, and BMP.

That appears to be a pretty solid definition. The CutyCapt tool does what it says on the tin and that’s it. You can’t really expect anything more – which is not a bad thing. You have one job and you need one tool. If the goal is to take a screenshot of a website via the terminal, the tool is CutyCat.

Make A Website Screenshot With CutyCapt:

Like oh so many, this article also requires an open terminal. 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.

With your terminal open, you’re going to need to install said CutyCapt. This may not be available for in all default repositories, but it’s in Debian/Ubuntu/Mint’s default repositories. So, using those as my example, you can install CutyCapt with:

Just know that your distro may not have this packaged, so follow the link in the preamble and find a way to install it in your distro of choice. You can compile it easily enough, should you need to go that far.

Once you have CutyCapt installed, it’s actually pretty easy. If you want use CutyCapt to take a screenshot of linux-tips.us, your command might look a little like this:

Or, in other words, it’s pretty basic:

It might look complicated, but CutyCapt is not all that complicated when you break it down. If the output size isn’t quite what you’re after (and it might not be), you can just keep playing with it until you get it exactly how you want it. The output format and expected screenshot size is all you need to worry about getting right.

Either way, as mentioned in the preamble, you can change the output. In our example, we specified .png. You need only change that and the output will change to what you specified. If you need any further assistance, you can use the classic man cutycapt to learn more about the application.

Closure:

See? You have yet another article. This one teaches you how to make a website screenshot with CutyCapt. It’s a pretty handy application to have on-hand if you’re into taking screenshots of websites. CutyCapt is only used for making screenshots and not a whole lot more than that, so it’s a one-trick-pony and intentionally so.

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.

How To: Hide The Output From wget

In today’s article you’re going to learn that you actually can hide the output from wget. I am not one of folks want to do this, but some do. Or at least the option is there, so I assume they do. Either way, read on and you’ll know how to hide the output from wget! 

Goodwood Revival is this weekend, but you’ll still get an article. I am thinking about going in person next year, so I’ll have to write articles ahead of time. I probably should have done that even though I’m just streaming it.

Anyhow, there’s an option that will let you hide the output from wget and it’s in my notes. I might as well turn it into an article because I’m sure someone wants to do this. 

What this does, to be clear, is shows no wget output in the terminal once you enter the command. You’re not running blind, however. I’ll show you how to at least ensure the command gets completed. So, it does have uses – when  you just don’t need to see the clutter.

Lots of people do loads of useful work in the terminal and don’t really need to see clutter, so this is one way to avoid that terminal clutter. I actually prefer to see what’s going on, but I’m weird like that. If you do not prefer to see what’s going on with wget, this article is for you!

Hide The Output From wget:

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.

It next requires that you use wget to get something. So, pick something and download it with wget. I don’t care what. You do you and download anything you want. To hide the output from wget, the command is:

That’s really it. However, you then have no idea if it it completed. Fortunately, you can make sure wget completes its task (within reason) with the -c flag. So then the command would look like:

See? Pretty simple. That command will not only hide the output from wget, it will ensure the download is completed. You’ll avoid cluttering up your terminal, or something…

Closure:

There you have it! You now know you can, and how you can, hide the output from wget. You can even be reasonably sure it completes behind the scenes. It’s not a very difficult article to follow today, so consider it an easy day. Now, back to my racing…

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.

Who is, Simply whois

Today, we’re going to learn about whois. There’s not much to it, so it won’t be a very long article. Think of this article as some of the others, where it’s not so much about the tool (the tool is simple to use) it’s about making folks aware of the tool and the capability.

Have you ever wondered about a domain name? Maybe you want to see if it’s registered? Perhaps you want to see who has registered it? Maybe you’ve noticed they have great uptime and want to see the name servers so that you can deduce the hosting company? Perhaps you want to file an abuse report, or you just want to know who the owner is so that you can send them an email. Maybe you’re a stalker and just need to narrow it down a little! (I kid, please don’t stalk anyone.)

Well, you can do that and more with whois! Want to know when the domain name expires so that you can swoop in and steal it? Well, you might be able to do that with help from the handy whois command! You can at least see the expiration date. I tend to keep things registered well in advance, ’cause I’m forgetful and don’t want to lose a domain name.

Unfortunately, quite a bit of information in whois databases is intentionally wrong. Sometimes, the information is quite useless. Certain domains, like this one, have requirements – so I have to use my real name in the registration information (though they never actually check). Other domain names aren’t so particular and you can lie, use email forwarders for abuse complaints and contact info, and generally hide that sort of stuff from whois databases. Ah well…

So, who is whois?

whois:

You might just as well crack open a terminal. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and something useful should happen.

With your terminal open, go ahead and install whois. It’s surely in your default repositories, so just install it like you’d install any other software. As is the tradition, I’ll show you how to do it in Ubuntu or any apt-using distro:

Now, all you need to know is:

You don’t need the http, nor the www, just use the domain name. For example, you can:

I should point out that that’s not really my phone number. You probably shouldn’t call it. If you somehow need my phone number, just ask in private and I’ll share it with you – assuming there’s justification for doing so. Also, please don’t stalk me.

Anyhow, you can see when the domain expires, tell that I use a CDN and which one I use, see when the domain was registered, find out who the registrar is, etc… You can learn quite a bit of information from just that one command. Combined with something like traceroute and you can learn a lot.

Closure:

Anyhow, now you know about ‘whois’ and a bit about what you can do with it. If you want to go digging around, you can learn quite a bit – even if the domain’s behind a privacy fence. There are other tools, like MTR and dig (which we haven’t covered).

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.

Subscribe To Our Newsletter
Get notified when new articles are published! It's free and I won't send you any spam.
Linux Tips
Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.