Tag Archives: shell

How-to Disable Password Authentication on Linux

This how-to will explain how to disable password based authentication on Linux based systems. It is in continuation of our series on System Security. With the first one published on SSH keys based authentication. We wrote this as a lot of you sent us messages, on social media, to add tutorials on how to secure the server by disabling the password based authentication.

We recommend that the administrator should not attempt to disable password based authentication unless SSH keys are correctly setup and users can easily login using that method.

This is the second article in the series on “Systems Security”. The articles in the System Security series are listed below.

  1. How to setup SSH keys based authentication
  2. How to disable password based authentication (current article)
  3. How to setup UFW Firewall

Techie by day, blogger by night. Love the outdoors, enjoy traveling and building new and interesting things. Follow me if you want to know something.

How to check elapsed time in Terminal

When we have processes running for a while and we want to know how long they have been running, there are a few nifty ways we can check them on Mac and Linux/Unix. Here is one such method to check elapsed time in BASH.

First grab the process ID (PID) using the following command. In the following command, we are trying to grab the process ID of mongoDB.

pgrep mongo

pgrep command tells shell prompt on Mac/Linux/Unix terminal to capture the process ID (PID) of the process we are interested. In this case it is mongoDB.

Techie by day, blogger by night. Love the outdoors, enjoy traveling and building new and interesting things. Follow me if you want to know something.

How to tell if your Computer is 64 bit?

Modern computers are all 64bit. Barring a few netbooks. But if you have an older system like a Pentium 4 or even Core2Duo or equivalent, you might have a 64bit system. Majority of those were 32bits but some were built for 64bit architecture.

If you want to find out if your PC/laptop is 32bit or 64 bit, do the following in Ubuntu:

  • Start a command line Terminal
  • Type the following command:

lscpu

Techie by day, blogger by night. Love the outdoors, enjoy traveling and building new and interesting things. Follow me if you want to know something.

Geek Speak – Finding your Linux Version

Ever wonder what version of Linux is installed on your desktop. Here is how to find out:

At command line, type the following

~$ cat /etc/issue

In my case I get the following result:

Ubuntu 8.04.2 \n \l

Hence, my desktop is running Ubuntu 8.04.02

Alternatively you can also type the following:

~$ cat /etc/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=8.04
DISTRIB_CODENAME=hardy
DISTRIB_DESCRIPTION=”Ubuntu 8.04.2″

In case if you are running one of Debian releases, you can find out the Debian version on your system by typing:

~$ cat /etc/debian_release

lenny/sid

To find out the Linux kernel on your system, type the following:

~$ uname -r

2.6.24-23-generic

So now you can track the version of your Linux even during automatic upgrades.