• Home
  • Services
    • HR Services
      • HR Advisory Services
      • Contract Staffing
      • HR Outsourcing Services
      • Manpower Supply Services
      • Payroll Processing
      • Permanent Placement
      • Recruitment and Placement Services
      • Recruitment Process Outsourcing
      • Staffing Agency Services
    • DBA Support
      • DBA Consultancy Services
      • PostgreSQL Support
    • Website Maintenance
    • Company Registration Services
    • Virtual Office Space Address
  • Company
    • FAQs
    • About Us
    • Contact
  • Office Space
    • Virtual Space
    • Co-working Space
    • Private Space
    • Meeting Room
    • Locations
    • Add Listing
    • Dashboard
  • Blogs
  • Careers
    • Jobseeker
    • Employer
  • Courses

    About Courses

    • List Of Courses
    • Become an Instructor
    Greenplum

    Greenplum

    $1,500.00
    Read More
    Have any question?
    (+91)8148383856
    info@rayafeel.com
    Login
    RayaFeeL
    • Home
    • Services
      • HR Services
        • HR Advisory Services
        • Contract Staffing
        • HR Outsourcing Services
        • Manpower Supply Services
        • Payroll Processing
        • Permanent Placement
        • Recruitment and Placement Services
        • Recruitment Process Outsourcing
        • Staffing Agency Services
      • DBA Support
        • DBA Consultancy Services
        • PostgreSQL Support
      • Website Maintenance
      • Company Registration Services
      • Virtual Office Space Address
    • Company
      • FAQs
      • About Us
      • Contact
    • Office Space
      • Virtual Space
      • Co-working Space
      • Private Space
      • Meeting Room
      • Locations
      • Add Listing
      • Dashboard
    • Blogs
    • Careers
      • Jobseeker
      • Employer
    • Courses

      About Courses

      • List Of Courses
      • Become an Instructor
      Greenplum

      Greenplum

      $1,500.00
      Read More

      Blog

      • Home
      • Blog
      • Blog
      • How to change ssh port number & username instead direct root user access ?

      How to change ssh port number & username instead direct root user access ?

      • Posted by bushra.rayafeel
      • Categories Blog
      • Date May 28, 2022
      • Comments 0 comment

      1. Open the ssh configureation file

      vi /etc/ssh/sshd_config 
      port 217
      PermitRootLogin no
      

      You can disable root login by finding the line that says “PermitRootLogin yes” you can change it to “PermitRootLogin no”
      2.Then you’ll just need to restart ssh

      service sshd restart
      

      3.You can create a new username with ‘useradd username’ what ssh user do you want

      useradd rajick
      passwd  rajick
      

      give “rajick’ user password
      4.You can enable sudo access by running this command  file will be open then add rajick user access

      then add this line “username ALL=(ALL) ALL” username is whatever username you have I HAVE rajick so given as rajick 

      # visudo
      root    ALL=(ALL)       ALL
      rajick  ALL=(ALL)       ALL
      

      Note:Sudo will allow you to change into root

      5.ADDING PORT ON FIREWALL:

      After changed everything if your server running on firewall you have to add your new port on firewall  configuration file.
       Installation Of csf firewall on centoS/RED hat

      #vi /etc/csf/csf.conf
      TCP_IN = "20,21,22,25,53,80,110,143,443,465,587,993,217"
      

      Note: It’s only needed in tcp_in,You can add it to both if you want, but tcp_out won’t do anything,No changes are needed for udp_in or udp_out. SSH uses TCP.
      csf.allow is used to open all ports for specific IP addresses,You don’t need to make any changes to it, but you can add your local IP if you want.

      After any changes you’ll need to restart csf with: 
      #csf -r

      6.USER Switching problem at linux

      [rajick@vps ~]$ su -
      -bash: /bin/su: Permission denied
      
      If the user has sudo privelages you should be able to use 
      'sudo -s' or 'sudo su root'
      
      $ sudo -s
      [sudo] password for rajick:
      [root@vps rajick]#
      

      7.check the SSH connection 

      login as: root
      root@88.202.123.123's password:
      Access denied
      root@88.202.123.123's password:
      

      Note this root user not allowed,only rajick user allowed but port should be 217

      And more about CSF(configure security firewall) firewall:
       
      This checked for a block on your IP:
      #csf -g 103.5.133.63 
      note:you can check your internet ip at your google search keyword “MY ip” 

      This removed the block Ip:
      #csf -dr 103.5.133.63
      Note:your ip will be blocked if 5 failed logins in an hour.

      Tag:csf, linux, ssh

      • Share:
      bushra.rayafeel

      Previous post

      How to move the postgres logs file in linux ?
      May 28, 2022

      Next post

      How to work with Linux top command ?
      May 28, 2022

      Leave A Reply

      You must be logged in to post a comment.

      Connect with



      Search

      ADVERTISEMENT

      Latest Posts

      HOW VIRTUAL OFFICE IS GOING TO CHANGE YOUR BUSINESS STRATEGIES
      21Jun2022
      Take the best advantage of your Virtual Office
      21Jun2022
      Let’s discuss how corporates can improve their productivity through virtual office spaces?
      21Jun2022
      Virtual Office Space & Address Services
      21Jun2022
      HOW VIRTUAL OFFICES ARE TRANSFORMING BUSINESSES
      21Jun2022
      PostgreSQL

      PostgreSQL

      $800.00 $500.00
      Greenplum

      Greenplum

      $1,500.00
      Oracle Database

      Oracle Database

      $350.00
      2ndquadrant.in

      (+91) 8838953252

      ITsupport@rayafeel.com

      Company

      • About Us
      • Our Team

      COURSES

      • List Of Course
      • Become An Instructor

      Support

      • DBA Support
      • Consultancy Services

      Recommend

      • Login
      • Contact Us

      IT Services by rayafeel.com. Powered by Rayafeel Technologies Pvt Ltd.

      • Privacy
      • Terms

      Become An Instructor?

      Join thousand of instructors and earn money hassle free!

      Get Started Now

      Connect with

      Login with Google

      Login with your site account

      Connect with



      Lost your password?