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.
- 10-12-2012 #1Just 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.
- 10-12-2012 #2Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,664
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?i went on recovery mode and restores the line to "yes"...
but i still cant connect by putty or by scp.
do you have local, physical access, and if so, can you log in as root in a virtual terminal?
- 10-13-2012 #3Just Joined!
- Join Date
- Oct 2012
- Location
- Portugal
- Posts
- 3
- 10-13-2012 #4Just Joined!
- Join Date
- Oct 2012
- Posts
- 11
After you change PermitRootLogin back to "yes", rember to do:
To secure access, I usually just move SSH from port 22 to any other random port. Eg. port 1422Code:service sshd restart
- 10-13-2012 #5Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,664
okay. just make sure you add one, once you're back in.
what do you get back when you try to ssh in? if you run "ssh root@x.x.x.x" and get:-if the deamon is running, i dont know. how can i check that?
then it may not be running.Code:ssh: connect to host x.x.x.x port 22: Connection refused
if, however, you get a password prompt, e.g.:
then it is running.Code:root@x.x.x.x's password:
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
I see. Does the company from whom you've rented it provide technical support, in case you've locked yourself out?- no i dont have physical acess, its a rented remote dedicated server.
- 10-14-2012 #6Just 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!
.
- 10-15-2012 #7Trusted Penguin
- Join Date
- May 2011
- Posts
- 3,664
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.




