Enable root login via ssh on FreeBSD

chris (2006-05-02 16:52:08)
12777 views
1 replies
So with the new FreeBSD box up and running, I quite naturally wanted to log into it. However, any attempt I made from my laptop failed with 'connection refused' (or something like that). With no iptables/ipfw/ip-foo-filter-bla stuff installed (that I know about), I decided to check syslog on the host machine to see what was going on:

tail /var/log/messages:

May 2 12:57:00 brezhnev sshd[718]: error: PAM: authentication error for root from 192.168.1.102
May 2 12:57:01 brezhnev sshd[718]: error: PAM: authentication error for root from 192.168.1.102

hmm - poop. It seems FreeBSD isn't going to allow a root login over the network. This should be a problem - I'll just login as 'chris' and assume root with 'su'... Nope. Not that easy:

$ su
su: Sorry

So I can't even switch to the root user when logged in onto the local machine. Well as it turns out there is a simple answer to this.. Just add the user to the wheel group and then you can su as expected. To do this I had to remove the existing user 'chris' and re-add it. I suspect there's a groups file kicking around somewhere under /etc, but it wasn't immediately apparent, so off we go..

$ rmuser -y chris
$ adduser chris (accept all defaults, but ask for chris to be added to the group 'wheel'

From now on 'chris' can switch to root user, so we're back in business.


christo

comment
Emmanuel Tessua
2010-02-04 06:34:20

Thanx

Hey, thanx alot, that worked just fine for me!!

So with the new FreeBSD box up and running, I quite naturally wanted to log into it. However, any attempt I made from my laptop failed with 'connection refused' (or something like that). With no iptables/ipfw/ip-foo-filter-bla stuff installed (that I know about), I decided to check syslog on the host machine to see what was going on:

tail /var/log/messages:

May 2 12:57:00 brezhnev sshd[718]: error: PAM: authentication error for root from 192.168.1.102
May 2 12:57:01 brezhnev sshd[718]: error: PAM: authentication error for root from 192.168.1.102

hmm - poop. It seems FreeBSD isn't going to allow a root login over the network. This should be a problem - I'll just login as 'chris' and assume root with 'su'... Nope. Not that easy:

$ su
su: Sorry

So I can't even switch to the root user when logged in onto the local machine. Well as it turns out there is a simple answer to this.. Just add the user to the wheel group and then you can su as expected. To do this I had to remove the existing user 'chris' and re-add it. I suspect there's a groups file kicking around somewhere under /etc, but it wasn't immediately apparent, so off we go..

$ rmuser -y chris
$ adduser chris (accept all defaults, but ask for chris to be added to the group 'wheel'

From now on 'chris' can switch to root user, so we're back in business.


christo

reply iconedit reply