How to Setup Linux Server VPS using Git Bash on Windows - Debian 10

Published: 26 July 2021
on channel: Ricky Wahowa (rwahowa)
1,337
17

Setup Linux Server VPS using Git Bash on Windows - Debian 10

Here are the VPS I Recommended:
https://bizanosa.com/vpslist

Visit Vultr (VPS provider used in the video) : https://bizanosa.com/vultr

1 Deploy new VPS Server and login via Git Bash : 00:00
2 Create sudo user - Create root user - admin user : 6:42
3 Setup SSH Authentication using Git Bash : 12:33
4 Create a swap file in Debian 10 : 33:20

The post with all the commands in the video : https://bizanosa.com/debian-10-initia...

What this Linux Server setup will cover
This initial Server setup for a Linux Server on a VPS will cover the following:

Deploy your server on your VPS platform.
How to log into your Server using Git Bash.
Create a new sudo user for your Linux server.
Setup SSH Key authentication for Linux Server
Disable Root user login and password Authentication
Add Swap File


The above steps can also be followed to setup Ubuntu 20.04 LTS server.

Linux server setup post :

https://bizanosa.com/setup-linux-serv...

1 Deploy new VPS Server and login via Git Bash : 00:00

Step one, deploy a VPS server. Use any of these recommended VPS providers. Then follow the next steps to setup your server. In this setup, I have installed Debian 10 on my server. Use that to follow along .

After setting up your server, download Git bash from Git – Downloads (git-scm.com) . Download and install the full Git. Then open Git Bash.

Log into your server. The details to login will be sent to your email or will be shown on your VPS admin dashboard. In the following, you are logging in as root.

Log into your VPS Server via SSH using Git Bash:

ssh root@server-ip-address

Enter your password and you will be logged in.

2 Create sudo user – Create new Linux admin user : 6:42

Next thing once your server is up and running, create a new user. You should not use the root user on your production server. Create a new user on Debian as follows:

adduser newus5r

Call your user anything you prefer. Mine is newus5r.

Then , add the user to sudo group as follows:

usermod -aG sudo newus5r

NOTE : If you experience an error whereby sudo is not available, add it:.

Update your server:

apt update && apt upgrade

Install sudo

apt install sudo

Restart your server. You can do this via the admin dashboard of your VPS provider or by running :

shutdown -r

or

reboot

Log in as the new user because all the next steps must be completed as the new user. You will need to use sudo before each command.

3 Setup SSH Authentication using Git Bash : 12:33

On windows the home directory for Git Bash is your user’s home directory. On Windows, go to Local Disk C, then Users, then your username. That is your Home directory.

In your home directory, check if .ssh folder is available. If you cannot see it, then enable hidden files and folders under the view settings of File Explorer. If you still can’t see it, then create it.

Inside of the .ssh folder create another folder. I’ll call mine , Debian10Server. This is where I will store my generated SSH key pairs.

Note : The tilde’ (~) represents your home directory. Instead of typing the full path of your home directory, just use ~ .

Our SSH key pair will be stored in this path : ~/.ssh/Debian10Server .

Generate the SSH key Pair

This part is done on your local computer. NOT on the server. Open a new isnatnce of Git Bash and run the following in order to generate the Ssh keys:

ssh-keygen -t rsa -b 4096 -C "[email protected]" -f ~/.ssh/Debian10Server/firstserverkey_rsa

The keys will be named firstserverkey_rsa, that is firstserverkey_rsa.pub for the public key and firstserverkey_rsa for the private key. You can change the names.

Once you run the command above, Enter a passphrase for your key. A passphrase is a password for your key. You must add one to secure your private key even further.

Our SSH Key pair is now available in this folder : ~/.ssh/Debian10Server .

-b specifies the bits to be generated, in this case 4096 bits

-C is just a comment for the key. Add a comment for the key. Read more about SSH options here.



Add the public SSH key to Linux server

Still being done on the local computer. This is done as follows :

ssh-copy-id -i ~/path-to-public-key user@host

For instance we can add our public ssh key above as follows:

ssh-copy-id -i ~/.ssh/Debian10Server/firstserverkey_rsa.pub [email protected]





If this video was helpful to you, please consider supporting my channel : https://paypal.me/rwahowa
.
GET SOCIAL WITH ME:
FACEBOOK:   / rwahowa  
INSTAGRAM:   / rwahowa  
TWITTER:   / rwahowa  
VIMEO: https://vimeo.com/bizanosa/
WEBSITE : http://rwahowa.com


Watch video How to Setup Linux Server VPS using Git Bash on Windows - Debian 10 online without registration, duration hours minute second in high quality. This video was added by user Ricky Wahowa (rwahowa) 26 July 2021, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,33 once and liked it 1 people.