Your Ad Here Your Ad Here
Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: Linux help please!

  1. #1
    I did this step in a security tutorial for CentOS 5:

    Quote Originally Posted by 1esproc
    [*] Reconfigure OpenSSH
    Open /etc/ssh/sshd_config with vi and find the line with Port (enter /Port in command mode to search.) Change it to a number above 1024, I personally go with a 5-digit number no greater than 30000. Make sure you update your profile in your client to use the new port in future connections. While in sshd_config you should make some other changes, so edit or verify that the following settings match these values:

    Protocol 2
    MaxAuthTries 4
    PermitRootLogin no
    PermitEmptyPasswords no
    ClientAliveInterval 600
    Banner /etc/ssh/banner
    I exited the session and I can't log in to root now =( I wasn't done! How can I fix this? I made a different username and password that works but it has restricted access.

  2. BitTorrent   -   #2
    Poster BT Rep: +16BT Rep +16BT Rep +16BT Rep +16
    Join Date
    Dec 2007
    Posts
    211
    There are a few things you can do:

    1) As the different user, sudo su - to root
    2) As the different user, su root
    3) Reboot the machine and enter run level 1 (you will have to modify the boot parameters in grub)

    Hope this helps

  3. BitTorrent   -   #3
    So like " sudo vi /etc/ssh/sshd_config"? I get "dekoy is not in the sudoers file. This incident will be reported."

  4. BitTorrent   -   #4
    Poster BT Rep: +16BT Rep +16BT Rep +16BT Rep +16
    Join Date
    Dec 2007
    Posts
    211
    That means you didn't setup sudoers for the user "dekoy". You may want to try to "su root". Otherwise, you may need to have someone reboot the box and go into run level 1.

    In /etc/ssh/sshd_config:
    PermitRootLogin no

    That is a security option that should be set once you setup your user account with the correct sudo privileges.

    In the future, you should just leave a root shell open if you're applying any changes that could lock you out.

  5. BitTorrent   -   #5
    Bunny Hopper BT Rep: +18BT Rep +18BT Rep +18BT Rep +18
    Join Date
    May 2007
    Posts
    177
    You shouldn't have used this line:

    PermitRootLogin no



    While logged in as the other user, type "su" to change to root, edit the sshd_config again, change the above line to yes, then restart it:

    /etc/init.d/sshd restart

  6. BitTorrent   -   #6
    When I type su, it askes me for a password, I enter in the one for the username I created but it says incorrect password.

  7. BitTorrent   -   #7
    Poster BT Rep: +16BT Rep +16BT Rep +16BT Rep +16
    Join Date
    Dec 2007
    Posts
    211
    You can do step 3 if you have access to the remote console or a KVM switch.

  8. BitTorrent   -   #8
    fisherman's Avatar Poster BT Rep: +14BT Rep +14BT Rep +14
    Join Date
    Nov 2007
    Location
    The Emerald Isle
    Posts
    613
    Hopefully some of the linux guru's can help you out on this, but if your running linux on a server the best thing to do would be to request a re-install to save all the time messing about.

    I had a problem similar to this before and I "wasted" hours trying to sort it out and in the end I went for the re-install.

    When you get a new server the best security precaution is to right away update the kernel by typing >> yum update kernel, then change the password your provider gave u buy typing passwd and creat some crazy password with lots of @%^:? ect.... and following instructions.

    Sorry can't be more help to you and good luck
    Our revenge will be the laughter of our children - Bobby Sands

  9. BitTorrent   -   #9
    Poster BT Rep: +13BT Rep +13BT Rep +13
    Join Date
    May 2007
    Location
    Europe
    Posts
    683
    Quote Originally Posted by deKoy View Post
    When I type su, it askes me for a password, I enter in the one for the username I created but it says incorrect password.
    You need to enter the root password because you're attempting to access this user's privileges.

  10. BitTorrent   -   #10
    Bunny Hopper BT Rep: +18BT Rep +18BT Rep +18BT Rep +18
    Join Date
    May 2007
    Posts
    177
    delete

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •