Skip to content
Readerstacks logo Readerstacks
  • Home
  • Softwares
  • Angular
  • Php
  • Laravel
  • Flutter
Readerstacks logo
Readerstacks
ssh disable

Disable SSH or IP bounded on any ubuntu server?

Aman Jain, July 11, 2021February 22, 2024
How to Restrict SSH Access to Specific IP Addresses - Fedingo

Open SSH to everyone is a security risk. we can change these settings easily in 2 minutes. let’s have quick solution on this.

Open file /etc/hosts.deny with using vi or nano editor.

Command : sudo vi /etc/hosts.deny then add below line to the file.

sshd,sshdfwd-X11 : ALL

it will look like above file. it will disable all ssh request.

After this close this file and open another file named as hosts.allow

Command : sudo vi /etc/hosts.allow

sshd : 192.168.0.0/24 // your ip address or client ip address
sshd : 127.0.0.1
sshd : [::1]

You are done. now you only be able to access the server using the defined ip address in server.

Additionally you can restrict SSH access by username as well.

  1. Open the /etc/ssh/sshd_config file usingg vi
    Command : sudo vi /etc/ssh/sshd_config

    PermitRootLogin no
    AllowUsers      user1 user2 user3 etc
    PasswordAuthentication yes

PermitRootLogin no configuration will disable the root login into the server and AllowUsers  will only allow mentioned usernames.

Related

Softwares Devops Ubuntu SecuritySShUbuntu

Post navigation

Previous post
Next post

Related Posts

Javascript Arrow function

What is arrow functions in JavaScript / ES6?

June 12, 2021November 8, 2023

arrow functions in JavaScript are introduced in ES6, before es6 we used normal function which needs to write more code to achieve the functionality. let take an example of arrow functions and es5 normal functions are follow: Normal functions of es5 Arrow functions of es6 uhmm! its looking like so…

Read More

How to start, stop and restart apache linux ?

August 28, 2021August 28, 2021

Before start i hope you know well about the apache, if not then you can read this article what is apache and install on ubuntu. Commands to start, stop, status and restart the apache are as follow: Start Apache in ubuntu command line sudo service apache2 start Restart Apache in…

Read More
Devops Install php, apache, mysql(Lamp) and phpmysadmin on Ubuntu

How to Install php apache mysql(Lamp) and phpmysadmin on Ubuntu

September 18, 2021November 8, 2023

In this article we will learn to Install php apache mysql(Lamp) and phpmysadmin on Ubuntu. PHP, Apache MySQL and phpMyAdmin is most useful part to run a web application like PHP. In this tutorial we will cover installation of PHP 7, Apache, MySQL and phpMyAdmin. Here is the list of…

Read More

Aman Jain
Aman Jain

With years of hands-on experience in the realm of web and mobile development, they have honed their skills in various technologies, including Laravel, PHP CodeIgniter, mobile app development, web app development, Flutter, React, JavaScript, Angular, Devops and so much more. Their proficiency extends to building robust REST APIs, AWS Code scaling, and optimization, ensuring that your applications run seamlessly on the cloud.

Categories

  • Angular
  • CSS
  • Dart
  • Devops
  • Flutter
  • HTML
  • Javascript
  • jQuery
  • Laravel
  • Laravel 10
  • Laravel 11
  • Laravel 9
  • Mysql
  • Php
  • Softwares
  • Ubuntu
  • Uncategorized

Archives

  • July 2025
  • June 2025
  • May 2025
  • April 2025
  • October 2024
  • July 2024
  • February 2024
  • January 2024
  • December 2023
  • November 2023
  • October 2023
  • July 2023
  • March 2023
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • January 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021

Recent Posts

  • Mapping Together: The Vibrant Spirit of OpenStreetMap Japan
  • Understanding High Vulnerabilities: A Deep Dive into the Weekly Summary
  • Building a Million-Dollar Brand: The Journey of Justin Jackson
  • Mastering Schedule Management with Laravel Zap
  • The Resilience of Nature: How Forests Recover After Fires
©2023 Readerstacks | Design and Developed by Readerstacks
Go to mobile version