Cannot SSH as root

I can SSH using other accounts, but not as root to a 10.4.4 server.

In the past iterations of OS X server, I had to manually edit the /etc/ssh/ssh_config file (or something like that) and edit a parameter to allow root SSH's.

Now that 10.4 Server has Service ACL's, it'd be nice to just go, grab root, and add it to the list, but I cannot.

What's the best way?

This is mostly due to the fact that I'm creating replicas....

Thanks,
j

Many different systems..., Mac OS X (10.4.4)

Posted on Jan 25, 2006 7:28 AM

Reply
11 replies

Jan 27, 2006 3:41 AM in response to Jeremy Matthews

There are two ways to lock out root from direct SSH login. One is /etc/sshd_config and the other is service Limitations in ServerAdmin. The former simply will play "dumb" and not accept any password for root for ssh login. The latter will catch a little later in the process by refusing the authentication for root against Netinfo for the ssh service.

As mentioned before I'd NEVER allow direct SSH login by root. Not from the LAN, and especially not from the WAN. I'd even go as far as changing the default ssh port from 22 to something obscure. (Which sadly isn't easy with 10.4 and launchd)

I actually only know a single thing where you need direct ssh root login and that is to set up an OD replica. Once that is established, you can disable root ssh login again.
MacLemon

Jan 27, 2006 3:52 AM in response to MacLemon

Hi MacLemon,

There also a nice saying "Security by obscurity". In the hope this will not be a long political discussion 🙂 i will try to give an alternative..

Use the firewall and block ssh traffic from all unknown IP adresses - a much nicer solution.

And even if i know i's only a few years back since the last hole in SSH was discovered, i would say that this is one of the more secure protocols to hold open for all traffic on the public network. I could find other protocols that i would rarther shut down...

/Martin

Jan 27, 2006 4:09 AM in response to schyth

I didn't mean to refer to "security by obscurity". Blocking outside ssh access from all unknown IPs sometimes is not feasable. For example if you frequently need to access a machine from varying customers whose IP ranges you cannot predict.

By changing the ssh port you can at least reduce the lines for bad login attempts that are generated at an increasing rate by automated scripts that usually don't bother to scan for open ports and then try to find an ssh server on a non-standard port.

Of course with an auditing tool like Nessus you can find the port and service. I totally agree. It's just that most automated attacks target standard ports and in that case moving to an obscure port will give you a lot more silence in your secure.log.

Of course a really good password or public key authentication will further help to increase security. (In my case public key auth is not possible either, since I need to access from my varying customer's machines.)
MacLemon

Jan 27, 2006 5:54 AM in response to MacLemon

Interesting stuff guys...

In the past, I've actually changed ports a number of times...until we started running into clients tat refused to do this, due to SysAdmin policy and, of course, that some apps that use SSH/2 run on 22, and cannot be changed. This resulted in creating special firewall rules and rerouting of packets...and made life a little bit less comfortable.

Still good stuff..but sometimes doesn't work for a number of reasons.

And yes...I enjoy the SACL's in 10.4 server....MUCH nicer than editing text files 🙂

Thanks again,
jeremy

Feb 1, 2006 5:50 PM in response to Dave Walcott

Dave,

Thanks for the tip!

When establishing (Mac OS X Server) replicas in a Mac OS X-based Open Directory environment, the replica must be established using the following:

Root IP address
Root Password
Directory Admin short name
Directory Admin password

So it uses those credentials to connect as root in order to establish it as a trusted source...I;ve tried using other admin credentials, but it only likes root.

-jeremy

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Cannot SSH as root

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.