Warning: Undefined array key "HTTP_ACCEPT_LANGUAGE" in /home/u596154002/domains/usbusinessreviews.com/public_html/wp-includes/load.php on line 2057

Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rank-math domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u596154002/domains/usbusinessreviews.com/public_html/wp-includes/functions.php on line 6114
The basics of SSH usage - Best Business Review Site 2024

The basics of SSH usage

[ad_1]

If you ever have to do any remote administration, at some point you’re going to have to log into a Linux server and get to work. To do that, you’re going to need to use SSH (aka Secure Shell). For those that have never been exposed to such a tool, you’re in for a treat.

What is SSH?

SSH is a secure means of logging into a remote machine. Once logged in, you can run any command you need to work with the server. Before you think that using SSH is difficult, fret not. Using SSH is not only fairly easy, but it’s also really quite powerful. 

I want to walk you through the first steps of using SSH. I’ll be demonstrating on Pop!_OS Linux but this information will work on any distribution of Linux that supports SSH (which is most of them). The only things you’ll need to follow along with this tutorial are two running instances of Linux. That’s it. Let’s get busy with SSH.  

Basic SSH login

Using SSH makes it possible for you to log in from a local machine to a remote machine. You’ll need user accounts on both machines. Those accounts don’t have to be the same on each machine (I’ll explain this in a minute), but you do need to have login credentials for both.

You will also need the IP address (or domain) of the server you want to log into. Let’s say, for example’s sake, our remote server is at IP address 192.168.1.11 and our user account is the same on both machines. Log into your desktop computer, open a terminal window, and log in to the remote machine with the command:

ssh 192.168.1.11

You will be prompted for your username on the remote machine. Once you’ve successfully authenticated with the password, you’ll be logged into the remote machine, where you can start working.

Now, what if your username on the remote machine isn’t the same as the one on the desktop? Let’s say your username on the remote machine is olivia. To log in with that username, the command would be:

ssh olivia@192.168.1.11

You will be prompted for olivia’s password (not the local user’s).

Normally, SSH uses port 22. Some administrators might change that port (for security purposes). If the server administrator has configured SSH to listen to port 2022, you can’t simply type the standard SSH command to log in. Instead, you have to add the -p option like so:

ssh olivia@192.168.1.11 -p 2022

SSH Site configuration

Remembering all of those IP addresses and usernames can be a real headache for some. Fortunately, SSH makes it possible for you to create a configuration file that houses all of this information. Say, for example, you have the following list of servers you log into:

  • webserver – 192.168.1.11
  • email server – 192.168.1.12
  • database server – 192.168.1.13

Let’s configure SSH such that you would only have to log in with the commands:

  • ssh web1
  • ssh email1
  • ssh db1

We’ll also assume that the user on web1 is olivia, the user on email1 is nathan, and the user on db1 is the same as the user on the local machine. To set this up, we must create a config file in the ~/.ssh directory. For that, go back to the terminal window on your local machine and issue the command shown in Figure A.

ssha.jpg

Creating a new SSH config file with the nano editor.


Image: Jack Wallen

Where USER is your Linux username.

In that file, add the following lines:

Host web1
   Hostname 192.168.1.11
   User olivia

Host email1
   Hostname 192.168.1.12
   User nathan

Host db1
   Hostname 192.168.1.13

Save and close the file. You should now be able to log into those different servers with the shorter commands (i.e. ssh web1, ssh email1, and ssh db1). It’s important to remember, however, that for web1 you’ll be prompted for olivia’s password, email1 will ask for nathan’s password, and db1 will ask for the same user as the local one.

Running commands on a remote machine with SSH

This is a handy little trick. Let’s say you don’t necessarily want to log into a remote machine but you do need to run a command. For example, you want to list out the contents of the remote user’s home directory. For that, you could issue the command:

ssh olivia@192.168.1.11 ls /home/olivia

Since we’ve set up our config file, we can truncate that command to:

ssh web1 ls /home/olivia

We can cut off a bit more from that command because Linux has a shortcut for a user’s home directory (because /home/olivia and ~/ are the same things). For that, our command becomes:

ssh web1 ls ~/

And that, my dear friends, is the basics of using SSH to log into a remote Linux machine. If you ever have to do any remote administration of a Linux machine, this is what you’ll need to know. Next time around, I’ll introduce you to SSH Key Authentication, for even more secure remote logins.

[ad_2]

Source link

slot gacor slot gacor togel macau slot hoki bandar togel slot dana slot mahjong link slot link slot777 slot gampang maxwin slot hoki slot mahjong slot maxwin slot mpo slot777 slot toto slot toto situs toto toto slot situs toto situs toto situs toto situs toto slot88 toto slot slot gacor thailand slot bet receh situs toto situs toto slot toto slot situs toto situs toto situs toto situs togel macau toto slot slot demo slot pulsa slot pragmatic situs toto deposit dana 10k surga slot toto slot link situs toto situs toto slot situs toto situs toto slot777 slot gacor situs toto slot slot pulsa 10k toto togel situs toto slot situs toto slot gacor terpercaya slot dana slot gacor pay4d agen sbobet kedai168 kedai168 deposit pulsa situs toto slot pulsa situs toto slot pulsa situs toto situs toto situs toto slot dana toto slot situs toto slot pulsa toto slot situs toto slot pulsa situs toto situs toto situs toto toto slot toto slot slot toto akun pro maxwin situs toto slot gacor maxwin slot gacor maxwin situs toto slot slot depo 10k toto slot toto slot situs toto situs toto toto slot toto slot toto slot toto togel slot toto togel situs toto situs toto toto slot slot gacor slot gacor slot gacor situs toto situs toto cytotec toto slot situs toto situs toto toto slot situs toto situs toto slot gacor maxwin slot gacor maxwin link slot 10k slot gacor maxwin slot gacor slot pulsa situs slot 10k slot 10k toto slot toto slot situs toto situs toto situs toto bandar togel 4d toto slot toto slot