Find the answer to your Linux question:
Results 1 to 7 of 7
hello, i need some help cos im new with linux and i've messed up. i have a rented remote server with ubuntu 10.04 that was taking some attacks and wild ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2012
    Location
    Portugal
    Posts
    3

    sshd_config problem - access denied


    hello, i need some help cos im new with linux and i've messed up.

    i have a rented remote server with ubuntu 10.04 that was taking some attacks and wild login attempts.

    i made a test by shutting down ssh acess on sshd_config by
    changing "PermitRootLogin" to "no"... test was fine but the noob here got locked outside, obviusly...

    i went on recovery mode and restores the line to "yes"...
    but i still cant connect by putty or by scp.

    is there any pro in the house that can gimme a good advice?
    thanks.

  2. #2
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by jpreia View Post
    hello, i need some help cos im new with linux and i've messed up.

    i have a rented remote server with ubuntu 10.04 that was taking some attacks and wild login attempts.

    i made a test by shutting down ssh acess on sshd_config by
    changing "PermitRootLogin" to "no"... test was fine but the noob here got locked outside, obviusly...
    Don't you have a regular, non-root account on the system? If not, then once you're back in, that should be the first thing you do.

    i went on recovery mode and restores the line to "yes"...
    but i still cant connect by putty or by scp.
    is the ssh daemon running?

    do you have local, physical access, and if so, can you log in as root in a virtual terminal?

  3. #3
    Just Joined!
    Join Date
    Oct 2012
    Location
    Portugal
    Posts
    3
    Quote Originally Posted by atreyu View Post
    Don't you have a regular, non-root account on the system? If not, then once you're back in, that should be the first thing you do.

    is the ssh daemon running?

    do you have local, physical access, and if so, can you log in as root in a virtual terminal?
    thanks for reply,

    -well, i dont have that user account, i connect to the root.

    -if the deamon is running, i dont know. how can i check that?

    - no i dont have physical acess, its a rented remote dedicated server.

    can you help me?

  4. #4
    Just Joined!
    Join Date
    Oct 2012
    Posts
    11
    After you change PermitRootLogin back to "yes", rember to do:
    Code:
    service sshd restart
    To secure access, I usually just move SSH from port 22 to any other random port. Eg. port 1422

  5. #5
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Quote Originally Posted by jpreia View Post
    well, i dont have that user account, i connect to the root.
    okay. just make sure you add one, once you're back in.

    -if the deamon is running, i dont know. how can i check that?
    what do you get back when you try to ssh in? if you run "ssh root@x.x.x.x" and get:
    Code:
    ssh: connect to host x.x.x.x port 22: Connection refused
    then it may not be running.

    if, however, you get a password prompt, e.g.:
    Code:
    root@x.x.x.x's password:
    then it is running.

    you can also try nmap to see open ports (and thus, possible daemons - like sshd - that are listening) on the server, e.g.:
    Code:
    nmap -n x.x.x.x
    - no i dont have physical acess, its a rented remote dedicated server.
    I see. Does the company from whom you've rented it provide technical support, in case you've locked yourself out?

  6. #6
    Just Joined!
    Join Date
    Oct 2012
    Location
    Portugal
    Posts
    3
    atreyu and Linux-Sys-Adm: THANK YOU VERY MUCH FOR HELP! PROBLEM SOLVED!

    - we were trying to use the "service sshd restart" after disconnecting the recovery mode, but we not sure if it would work, cos meanwhile the provider created us a user account and changed the server pass, and that was messing with our try outs... but now we have a user account.

    - now we can connect to the server.

    - very good security tip changing the 22 default door for a random one, we taking care of that.

    - atreyu thanks for those very usefull check commands.

    once again thanks and best wishes. CONGRATS! GREAT FORUM!

    .

  7. #7
    Trusted Penguin
    Join Date
    May 2011
    Posts
    4,353
    Glad you got it sorted, and found the forums helpful.

    You can now mark this thread as Solved via the Thread Tools near the top, over the thread posts.

Posting Permissions

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