• 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
  • Locations
  • Blogs
    • Blog
    • Blog – PostgreSQL Support
    • Blog – PostgreSQL Migration
    • Blog – All DB’s
    • Blog – Linux
  • Courses

    About Courses

    • List Of Courses
    • Become an Instructor
    Greenplum

    Greenplum

    $1,500.00
    Read More
    Have any question?
    (+91)8838953252
    ITsupport@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
    • Locations
    • Blogs
      • Blog
      • Blog – PostgreSQL Support
      • Blog – PostgreSQL Migration
      • Blog – All DB’s
      • Blog – Linux
    • Courses

      About Courses

      • List Of Courses
      • Become an Instructor
      Greenplum

      Greenplum

      $1,500.00
      Read More

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

      • Home
      • 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 2ndnijam
      • Date February 10, 2019

      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.

      Contact Us

      Fields with (*) are compulsory.

      • Share:
      2ndnijam

      Previous post

      How to move the postgres logs file in linux ? and difference between ctime,mtime,atime,cmin,amin,mmin
      February 10, 2019

      Next post

      How to work with Linux top command ?
      February 13, 2019

      Search

      ADVERTISEMENT

      Latest Posts

      Tips to Choose the Best Serviced Office for Your Business
      24May2022
      What key considerations do you need to keep in mind when choosing a new serviced office to house your business?
      24May2022
      The Benefits of Coworking
      24May2022
      The Long-Term Impact of Coworking
      24May2022
      Are you spending more money than you earn? Outsource with Ease and Move When You’re Ready
      24May2022
      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 Twitter Login with Linkedin Login with Windowslive Login with Yahoo

      Login with your site account

      Connect with



      Lost your password?