Wierd happenings when securing SSH
I am trying to configure my SSH (on my slack 10.2 box) to deny login from ROOT and to allow login only from user "phonehome"
Here are the relevant lines I have in my /etc/ssh/sshd_config: PermitRootLogin no AllowUsers phonehome Why can I still login from root? I have tried killing the SSHD process with no luck. What am I doing wrong? |
Quote:
The SuSE way is Code:
sshd restart Code:
/etc/init.d/sshd restart One of these should work on slackware (although your sshd script path will probably differ). So you can tinker some more or wait for a slackware expert to see this. |
No, actually I did restart it. I did a "kill [proc id]". It restarted on its own and still didn't work.
I am issueing all of these commands from work over the SSH if that makes any difference. |
Quote:
Code:
ssh root@host_name |
I am using PUTTY from winxp. I ssh to my IP, it says LOGIN: I type root then the PW when it asks and BANG- Im in.
|
Totally strange. All I can think of is 1) sshd was not really restarted; or 2) the 'PermitRootLogin no' is not being parsed by the sshd script correctly because of an extra character or something.
Very curious to see the resolution for this one.... |
Quote:
|
Well, I was doing all of this editing thru SSH. I did Kill [Proc ID], and my connection was terminated. I tried logging in again as root and was successfull. I did ps -e and sshd had a new proc id. I supose this means that SSHD was restarted.
I guess I will have to physically look at the box when I get home. |
I'm guessing here, but I bet that you just killed the ssh session you were using at the time, not the ssh daemon. If you had actually killed sshd with kill, you absolutely shouldn't have been able to reconnect via ssh unless you've got some other program monitoring sshd and starting it up again if it dies.
By the way, if you us the restart command in my previous post, it actually will maintain the ssh connections in use. The way you did it, you would need physical access to the machine to restart sshd. |
Oh cool! I will try again from SSH in a little bit!
|
Some how I locked my self completely out of SSH. I need to get on the box physically and reconfig sshd_config to allow my user!
|
Okay, I recommented out AllowRootLogins no just see if I can get the SSHD config to take changes when I use them. I restarted SSHD by doing:
rc.sshd stop rc.sshd restart and it still denies all users (root included) Then I did rc.sshd stop rc.sshd start Same thing. How do I get SSHD to take my changes!!!!?? |
handog is right. Also ...
from sshd manpage: sshd rereads its configuration file when it receives a hangup signal, SIGHUP, by executing itself with the name and options it was started with, e.g., /usr/sbin/sshd. You could also edit your rc.sshd under the sshd_start function and add the -d parameter for debugging output |
If ssh is no longer allowing anyone in, you're going to have to dig through your logs (/var/log/messages and /var/log/syslog) to find some clues as to why. Even without the -d flag, ssh usually leaves some clue as to what is happening.
|
All times are GMT -5. The time now is 08:39 AM. |