SlideShare a Scribd company logo
1 of 14
Initial VPS Setup
Muhammad Arafat Azam
Topics I will cover
Creating a VPS (droplet) on Digitalocean.
Creating a new user with root privileges.
Setting up ssh.
Setting up a basic firewall.
Prerequisite
Access to an ubuntu 16.04 VPS.
OpenSSH for Linux of Mac.
An ssh client for windows (PuTTY / gitbash)
Installing ssh client
Download and install latest version of git from here: https://git-for-
windows.github.io/
Create a VPS
On digitalocean, VPS is called droplet.
Digital ocean’s interface is clean and beginner friendly.
To get 10$ beginner credit sign up with this referral link:
https://m.do.co/c/0dc352a7f06c
Log into the Droplet with root
By this time digitalocean has emailed the login credential.
Open a terminal and log in with this command and enter the emailed password:
ssh root@your_server_ip
We will be prompted to change the password.
Create a New user
root is the administrateive user. It has privileges to cause destructive changes
to our server.
We will create a new user with the following command:
adduser azam
Give it a ‘superuser’ or administrative privileges:
usermod -aG sudo azam
Generate an SSH key
SSH is a network protocol which is used to establish secure connection to
remote machine over the internet and run commands.
To generate an ssh key open a local terminal (ie: another git bash) and enter this
command:
ssh-keygen
Print the public key with the following command:
cat ~/.ssh/id_rsa.pub
Select and copy.
Copy the public key in the Droplet
On the remote terminal we will temporarily switch to the new user:
su - azam
Create an .ssh directory and restrict permission:
mkdir ~/.ssh
chmod 700 ~/.ssh
Open a file in .ssh named authorized_keys:
nano ~/.ssh/authorized_keys
Now paste the copied public key, hit ctrl+x and press y.
Restrict the permission of the authorized_keys:
chmod 600 ~/.ssh/authorized_keys
Disable Password Authentication
As a root user open the ssh daemon configuration:
sudo nano /etc/ssh/sshd_config
Find the line that has PasswordAuthentication and change its value to no:
PasswordAuthentication no
To save hit ctrl+x and press y.
Enter this to reload the ssh daemon:
sudo service sshd reload
Test Login
Do not exit the first remote terminal until we are certain that everything is
working fine.
Open a new terminal and log into the droplet with the new credential:
ssh azam@your_server_ip
If you need root privileges just type sudo before the command:
sudo some_command
Set Up Basic Firewall
On ubuntu 16.04 server we can use UFW - uncomplicated firewall.
Applications can register their profile with UFW.
To see the available application profiles:
sudo ufw app list
To allow SSH connection run:
sudo ufw allow OpenSSH
Enable the firewall by typing:
sudo ufw enable
Check ssh connection are allowed:
Initial vps setup with ubuntu 16.04

More Related Content

Recently uploaded

TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
VictorSzoltysek
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 

Recently uploaded (20)

Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM TechniquesAI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
AI Mastery 201: Elevating Your Workflow with Advanced LLM Techniques
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdfAzure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
Azure_Native_Qumulo_High_Performance_Compute_Benchmarks.pdf
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

Initial vps setup with ubuntu 16.04

  • 1.
  • 3. Topics I will cover Creating a VPS (droplet) on Digitalocean. Creating a new user with root privileges. Setting up ssh. Setting up a basic firewall.
  • 4. Prerequisite Access to an ubuntu 16.04 VPS. OpenSSH for Linux of Mac. An ssh client for windows (PuTTY / gitbash)
  • 5. Installing ssh client Download and install latest version of git from here: https://git-for- windows.github.io/
  • 6. Create a VPS On digitalocean, VPS is called droplet. Digital ocean’s interface is clean and beginner friendly. To get 10$ beginner credit sign up with this referral link: https://m.do.co/c/0dc352a7f06c
  • 7. Log into the Droplet with root By this time digitalocean has emailed the login credential. Open a terminal and log in with this command and enter the emailed password: ssh root@your_server_ip We will be prompted to change the password.
  • 8. Create a New user root is the administrateive user. It has privileges to cause destructive changes to our server. We will create a new user with the following command: adduser azam Give it a ‘superuser’ or administrative privileges: usermod -aG sudo azam
  • 9. Generate an SSH key SSH is a network protocol which is used to establish secure connection to remote machine over the internet and run commands. To generate an ssh key open a local terminal (ie: another git bash) and enter this command: ssh-keygen Print the public key with the following command: cat ~/.ssh/id_rsa.pub Select and copy.
  • 10. Copy the public key in the Droplet On the remote terminal we will temporarily switch to the new user: su - azam Create an .ssh directory and restrict permission: mkdir ~/.ssh chmod 700 ~/.ssh Open a file in .ssh named authorized_keys: nano ~/.ssh/authorized_keys Now paste the copied public key, hit ctrl+x and press y. Restrict the permission of the authorized_keys: chmod 600 ~/.ssh/authorized_keys
  • 11. Disable Password Authentication As a root user open the ssh daemon configuration: sudo nano /etc/ssh/sshd_config Find the line that has PasswordAuthentication and change its value to no: PasswordAuthentication no To save hit ctrl+x and press y. Enter this to reload the ssh daemon: sudo service sshd reload
  • 12. Test Login Do not exit the first remote terminal until we are certain that everything is working fine. Open a new terminal and log into the droplet with the new credential: ssh azam@your_server_ip If you need root privileges just type sudo before the command: sudo some_command
  • 13. Set Up Basic Firewall On ubuntu 16.04 server we can use UFW - uncomplicated firewall. Applications can register their profile with UFW. To see the available application profiles: sudo ufw app list To allow SSH connection run: sudo ufw allow OpenSSH Enable the firewall by typing: sudo ufw enable Check ssh connection are allowed:

Editor's Notes

  1. আপনি আপনার এপ্লিকেশন হোস্ট করার জন্য একটি নতুন সার্ভার বা ভিপিএস নিয়েছেন। কিন্তু এটিকে স্টেবল ও নিরাপদ কিভাবে করবেন? নতুন সার্ভার নেয়ার পর কি কি করা দরকার?
  2. আমি মুহাম্মদ আরাফাত আজম। আমি আজকে আপনাদেরকে দেখাব কিভাবে একটি নতুন সার্ভার সেটআপ করতে হয়।
  3. আমি আজকে যা যা দেখাব সেগুলো হল - ডিজিটাল অশানে একটি নতুন সার্ভার তইরি করা রুট প্রিভিলেজ সহ একটি নতুন ইউসার একাউন্ট তইরি করা। সিকিউর শেল বা এসএস এইচ সেট করা। বেসিক ফায়ার ওয়াল সেটআপ
  4. টিউটোরিয়াল অনুসরণ করতে হলে আপনার যা যা লাগবে সেগুলো হলও একটা উবুন্টু ১৬।০৪ ভিপিএস লিনাক্স বা ম্যক ব্যবহার কারি হলে ওপেন এস এস এইচ আর উইন্ডোজে একটি এস এস এইচ ক্লায়েন্ট
  5. উইন্ডোজে এস এস এইচ ক্লায়েন্ট গিতব্যশ ইন্সটল করার জন্য এই লিঙ্কটি অনুসরণ করুন। গিটের লেতেস্ত ভার্শন নামিয়ে ইন্সটল করুন। আপনি চাইলে পুতিও ব্যবহার করতে পারবেন।
  6. এই টিউটোরিয়ালের জন্য আমি ডিজিটাল অশানের ভিপিএস ব্যবহার করব। ডিজিটাল অশান একটি ক্লাউদ ইনফ্রাস্তাকচার প্রভাইদার। ডিজিটাল অশানে ভিপিএস্কে ড্রপ্লেট বলে। এর ইন্টারফেস অনেক পরিচ্ছন্ন এবং বিগিনার ফ্রেন্ডলি। আপনি যদি এই রেফারেল লিঙ্কটি অনুসরণ করে সাইন আপ করেন তবে দশ ডলার রেফারেল বোনাস পাবেন যা দিয়ে ৫১২ মেগা মেমরির ড্রপ্লেট দুমাস ব্যবহার করতে পারবেন।
  7. ড্রপলেট তইরি হয়ে গেলে একটা এমেইলে লগইন ক্রেদেনশিয়াল দিয়ে দেয়া হবে। প্রদত্ত পাসওয়ার্ড আমরা একবার ব্যবহার করতে পারব। একটা টার্মিনাল ওপেন করে আমরা ssh কমান্ড দিয়ে আমাদের ড্রপ্লেটে লগইন করব। নতুন পাসওয়ার্ড দিতে প্রম্পট করলে আমরা পাসওয়ার্ড পরিবর্তন করব।
  8. রুট হচ্ছে এদ্মিনিস্ত্রেতিভ ইউজার। রুট ইউজারের সব রকমের এক্কেস আমাদের সার্ভারে আছে। ফলে রুট দিয়ে কাজ করতে গিয়ে ভুল করে ফেললে সেটা বিপদজনক হতে পারে। এই কারণে আমরা একটা নতুন ইউজার তইরি করব। তারপর সেটাকে সুডো প্রিজিলেজ দিব।
  9. সিকিউর শেল বা এসএস এইচ একটি নেটওয়ার্ক প্রোটকল। এই প্রোটকল দিয়ে সার্ভার এডমিনরা বা সফটওয়ার ইঞ্জিনিয়ার রা নিজেদের কম্পিউটার থেকে রিমোট মেশিনে বা সার্ভারে নিরাপদে কমান্ড চালাতে পারে। আমরা একটা নতুন টার্মিনাল খুলে এস এস এইচ কি জেনারেট করব এরপর পাবলিক কি টা টার্মিনালে প্রিন্ট করে সেটা কপি করব। এই কি ব্যবহার করে আমরা আমাদের দ্রপ্লেতে লগইন করব।
  10. আমরা আমাদের প্রথম টার্মিনাল থেকে, যেটাতে আমরা আমাদের ভিপিএসে লগইন আছি সেখানে, নতুন ইউজার একাউন্টে সুইচ করব। হোম ডিরেক্টরিতে .ssh ডিরেক্টরি তইরি করব। সেখানে অথরাইজড কিস ফাইলে কপি করা পাবলিক কি টা যুক্ত করে দিব। এরপর আবার রুট ইউজারে সুইচ করব।
  11. যাতে এসএস এইচ কি ছাড়া লগইন না করা যায় সেজন্য পাসওয়ার্ড অথেনটিকেশন বন্ধ করে দিতে হবে। আমরা ssh daemon এর কনফিগারেশন ফাইলটি এডিট করব পাসওয়ার্ড অথেনটিকেশন বন্ধ করে দিব এবং সবশেশ এস এস এইচ দেমন রিলোড করব।
  12. আমরা যেহেতু পাসওয়ার্ড অথেক্তিকেশন বন্ধ করে দিয়েছি, এজন্য সব ঠিকমত কাজ করছে এটি নিশ্চিত করার আগে রিমোট টার্মিনাল থেকে এক্সিট করবনা। একটা নতুন টার্মিনাল খুলব এবং নতুন তইরি করা ইউজার দিয়ে লগইন করার চেষ্টা করব। রুট প্রিভিলেজ দিয়ে কোন কমান্ড চালাতে হলে শুরুতে sudo দিতে হবে।
  13. উবুন্টু সার্ভারে আমরা ufw বা uncomplicated firewall দিয়ে কোন কোন সার্ভিস এক্কেস করা যাবে সেটা নিয়ন্ত্রণ করতে পারি। প্রতিটি এপ্লিকেশন ইন্সটল হবার সময় নিজ নিজ প্রোফাইল UFW তে রেজিস্টার করে। আমরা এভেইলেবল এপ্লিকেশন প্রোফাইল চেক করব এস এস এইচ সার্ভিসকে আলাও করব এরপর ufw এনাবল করব সবশেষে দেখব কোন কোন সার্ভিস এলাও করা আছে। পরবর্তীতে আমরা যদি ওয়েব সার্ভার যেমন এঞ্জিনেক্স ইন্সটল করি সেটাও ufw তে এলাও করতে হবে
  14. আমরা দেখলাম আমরা কিভাবে একটা ভিপিএস এ নতুন ইউজার তইরি করে এসএস এইচ এক্কেস দিতে পারি। এবং uncomplicated firewall দিয়ে আমাদের সার্ভার সুরক্ষিত করতে পারি। এই ভিডিওর প্রেসেন্টেশনের লিঙ্ক ভিডিওর ডেসক্রিপশনে দেয়া আছে। জাজাকাল্লাহ খাইরান।