Activity Stream
48,167 MEMBERS
62548 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1.     
    #1
    Member
    Website's:
    ihide.info experthide.com hideonthe.net

    Default [TUT] Securing SSH a bit ;)

    Hi,

    Here is a little tut I made cause I got bored . Enjoy

    Step 1 : Add a Regular User
    Code: 
    adduser sshadmin && passwd sshadmin
    
    *Note* After entering this command you will be prompted to enter a password.
    Step 2 : Backup your current sshd_config
    Code: 
    mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
    Step 3 : Create a new sshd_config file
    Code: 
    nano -w /etc/ssh/sshd_config
    Step 4 : Paste this into the new file.
    Code: 
    ## Change to other port is recommended, etc 2488
    Port 22
     
    ## Sets listening address on server. default=0.0.0.0
    #ListenAddress 192.168.0.1
     
    ## Enforcing SSH Protocol 2 only
    Protocol 2
     
    ## Disable direct root login, with no you need to login with admin user, then "su -" you into root
    PermitRootLogin no
     
    ##
    UsePrivilegeSeparation yes
     
    ##
    AllowTcpForwarding no
     
    ## Disables X11Forwarding
    X11Forwarding no
     
    ## Checks users on their home directority and rhosts, that they arent world-writable
    StrictModes yes
     
    ## The option IgnoreRhosts specifies whether rhosts or shosts files should not be used in authentication
    IgnoreRhosts yes
     
    ##
    HostbasedAuthentication no
     
    ## RhostsAuthentication specifies whether sshd can try to use rhosts based authentication. 
    RhostsRSAAuthentication no
     
    ## Adds a login banner that the user can see
    Banner /etc/motd
     
    ## Enable / Disable sftp server
    #Subsystem      sftp    /usr/libexec/openssh/sftp-server
     
    ## Add users that are allowed to log in
    AllowUsers sshadmin
    The port number should be changed to something else (Example : 2194
    Ctrl + x to save it now.


    Step 5 : Restart SSHD
    Code: 
    service sshd restart
    *Note* Do not close your current ssh window in case of problems

    Now open a new ssh window and try connecting with the port and the user you added. Once you are logged into type su - and it will ask you for root pass. Once you enter it correctly blamo your in
    .:Raymond:. Reviewed by .:Raymond:. on . [TUT] Securing SSH a bit ;) Hi, Here is a little tut I made cause I got bored :P. Enjoy Step 1 : Add a Regular User adduser sshadmin && passwd sshadmin *Note* After entering this command you will be prompted to enter a password. Step 2 : Backup your current sshd_config Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    ihide.info
    nice. hope people use this to be more secure.
    KWWH has turned gay. I will not return until Phamous is demoted.

  4.     
    #3
    Member
    Website's:
    csoffensive.com fagbag.me
    ya ur security seems to be the best

    but seriously thanks for the effort

  5.     
    #4
    Member
    Website's:
    ihide.info experthide.com hideonthe.net
    @ShareShiz

    why fail o.O

  6.     
    #5
    Member
    Website's:
    ihide.info experthide.com hideonthe.net
    @QuickSand

    being sarcastic

  7.     
    #6
    Member
    Thanks!

    And i'm commenting out "Banner /etc/motd" too skip displays stats of server twice.

  8.     
    #7
    Member
    Website's:
    WRZhost.com WExplain.com
    basic ssh security, everyone should do this!
    nice one mate
    Any questions? Want to make money?My Online Marketing Forum
    WRZhost offshore hosting! Still the best offshore hosting after 7 years! Hongkong,Russia,NL,Germany

  9.     
    #8
    Member
    Website's:
    ihide.info experthide.com hideonthe.net
    Thanks tippie

  10.     
    #9
    Banned
    Long description. I think almost all SSH pros using this method.
    It's very easy to do if you are using kloxo panel. login to panel and change ssh port. that's all
    Quote Originally Posted by Forgiven View Post
    Hi,

    Here is a little tut I made cause I got bored . Enjoy

    Step 1 : Add a Regular User
    Code: 
    adduser sshadmin && passwd sshadmin
    
    *Note* After entering this command you will be prompted to enter a password.
    Step 2 : Backup your current sshd_config
    Code: 
    mv /etc/ssh/sshd_config /etc/ssh/sshd_config.bak
    Step 3 : Create a new sshd_config file
    Code: 
    nano -w /etc/ssh/sshd_config
    Step 4 : Paste this into the new file.
    Code: 
    ## Change to other port is recommended, etc 2488
    Port 22
     
    ## Sets listening address on server. default=0.0.0.0
    #ListenAddress 192.168.0.1
     
    ## Enforcing SSH Protocol 2 only
    Protocol 2
     
    ## Disable direct root login, with no you need to login with admin user, then "su -" you into root
    PermitRootLogin no
     
    ##
    UsePrivilegeSeparation yes
     
    ##
    AllowTcpForwarding no
     
    ## Disables X11Forwarding
    X11Forwarding no
     
    ## Checks users on their home directority and rhosts, that they arent world-writable
    StrictModes yes
     
    ## The option IgnoreRhosts specifies whether rhosts or shosts files should not be used in authentication
    IgnoreRhosts yes
     
    ##
    HostbasedAuthentication no
     
    ## RhostsAuthentication specifies whether sshd can try to use rhosts based authentication. 
    RhostsRSAAuthentication no
     
    ## Adds a login banner that the user can see
    Banner /etc/motd
     
    ## Enable / Disable sftp server
    #Subsystem      sftp    /usr/libexec/openssh/sftp-server
     
    ## Add users that are allowed to log in
    AllowUsers sshadmin
    The port number should be changed to something else (Example : 2194
    Ctrl + x to save it now.


    Step 5 : Restart SSHD
    Code: 
    service sshd restart
    *Note* Do not close your current ssh window in case of problems

    Now open a new ssh window and try connecting with the port and the user you added. Once you are logged into type su - and it will ask you for root pass. Once you enter it correctly blamo your in

  11.     
    #10
    Member
    Website's:
    ihide.info experthide.com hideonthe.net
    @motion
    disabling direct root login and adding the regular user is also a good security measure.

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Securing php-fpm with nginx
    By masterb56 in forum Technical and Security Tutorials
    Replies: 4
    Last Post: 29th Aug 2011, 08:46 AM
  2. [TUT] Securing /tmp and /dev/shm partion
    By .:Raymond:. in forum Technical and Security Tutorials
    Replies: 6
    Last Post: 9th Jun 2011, 08:47 AM
  3. [Selling] VPS Securing Services
    By iL < in forum Completed Transactions
    Replies: 2
    Last Post: 31st Mar 2010, 05:13 AM
  4. Need help securing VPS!!
    By lukip006 in forum Server Management
    Replies: 5
    Last Post: 31st Aug 2009, 04:14 PM
  5. securing vb forum
    By lenney in forum vBulletin
    Replies: 16
    Last Post: 19th Jul 2009, 08:43 PM

Tags for this Thread

BE SOCIAL