PDA

View Full Version : Disable direct root login


jort
16th March 2005, 01:04 PM
Hello,

I'm trying to disable direct root login via SSH. There are lots of tutorials available via Google how to disable direct root login.

The tutorial:
1. SSH into your server as 'admin' and gain root access by su

2. Copy and paste this line to edit the file for SSH logins
pico -w /etc/ssh/sshd_config

3. Find the line
Protocol 2, 1

4. Uncomment it and change it to look like
Protocol 2

5. Next, find the line
PermitRootLogin yes

6. Uncomment it and make it look like PermitRootLogin no

7. Save the file Ctrl+X then Y then enter

8. Now you can restart SSH
/etc/rc.d/init.d/sshd restart
But when I open a shell (terminal) and type ssh -l jort MY-IP-ADDRESS, I get no response. What do I have to do?

awdac
16th March 2005, 03:18 PM
Are you saying that you can't log in via ssh at all anymore, or just as jort? Are you sure the firewall is not blocking connections to port 22? If you are getting no response, it sounds like it's getting blocked, rather than sshd denying you.

jort
16th March 2005, 04:21 PM

Are you saying that you can't log in via ssh at all anymore, or just as jort? Are you sure the firewall is not blocking connections to port 22? If you are getting no response, it sounds like it's getting blocked, rather than sshd denying you.
Could it have something to do with the fact that I'm trying to connect from and to the same computer? Port 22 is open to everybody according to Firestarter.

bcruze
31st March 2005, 10:30 PM
http://www.webhostgear.com/24.html

works for me

jort
1st April 2005, 02:58 PM
I'm sure that's a good article, but I even cannot log on via SSH on my computer.

I open a terminal and type SSH [hostname] and just get no response.

What to do?

w5set
1st April 2005, 03:39 PM
You are trying to logon the same computer that you are using the keyboard on--using SSH?

jort
1st April 2005, 04:39 PM
You are trying to logon the same computer that you are using the keyboard on--using SSH?
Yes, I am.