LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices

Reply
 
Search this Thread
Old 09-09-2009, 08:03 AM   #1
manya
Member
 
Registered: Apr 2004
Posts: 194

Rep: Reputation: 15
ssh is not allowing me to login


Hi Guys,

I am new to FreeBSD and just completed my first installation. I am trying to access this system via SSH but system is not allowing me to log in while it is prompting for the password. Don't know what went wrong or I missed anything.

Please advise...
 
Old 09-09-2009, 10:47 AM   #2
Lee_Ball
Member
 
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132

Rep: Reputation: 18
So it prompts for username and password ok then?

Does it say login incorrect when you try and login? Also, who are you trying to login as?
 
Old 09-09-2009, 11:59 AM   #3
anomie
Senior Member
 
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora, Lubuntu, FreeBSD
Posts: 3,930
Blog Entries: 5

Rep: Reputation: Disabled
Quote:
Originally Posted by manya
I am new to FreeBSD and just completed my first installation. I am trying to access this system via SSH but system is not allowing me to log in while it is prompting for the password. Don't know what went wrong or I missed anything.
I'm going to guess that you're trying to log in over ssh as root. Is that right? If so, it's disabled by default. (ssh in as a regular user and then su to root instead.)

If that doesn't help, then tail /var/log/auth.log on the FreeBSD host while trying to ssh in. Post the messages you see here.
 
Old 09-09-2009, 10:15 PM   #4
manya
Member
 
Registered: Apr 2004
Posts: 194

Original Poster
Rep: Reputation: 15
That's right anomie, I tried login as root but even I did the same thing with normal user and tried su - and system says BAD SU - over .

Right now I do not have FreeBSD machine in front of me. Will paste the auth.log o/p later
 
Old 09-10-2009, 04:02 AM   #5
Lee_Ball
Member
 
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132

Rep: Reputation: 18
Try su root rather then just su.

Sounds like you're now logging into the box correctly using SSH though, your issue now is elevating your privileges.
 
Old 09-10-2009, 06:41 AM   #6
Fin7PL
Member
 
Registered: Mar 2005
Location: Finland
Distribution: FreeBSD 9.0
Posts: 59

Rep: Reputation: 16
Is your user part of the wheel group?

Code:
pw group show wheel
If not

Code:
pw usermod "yourname" -G wheel
Ofc you have to do that as root and then ssh your user in and try su

Last edited by Fin7PL; 09-10-2009 at 06:45 AM.
 
Old 09-14-2009, 09:24 AM   #7
manya
Member
 
Registered: Apr 2004
Posts: 194

Original Poster
Rep: Reputation: 15
I could login with normal user then su to become root via ssh using pw method, but there is no way by which we can allow root to access directly via ssh.
 
Old 09-15-2009, 03:30 AM   #8
Lee_Ball
Member
 
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132

Rep: Reputation: 18
Quote:
Originally Posted by manya View Post
I could login with normal user then su to become root via ssh using pw method, but there is no way by which we can allow root to access directly via ssh.
You can, but its not recommended as people will already be trying to login by root, and once they have compromised your password they will have root access.

But, as with all things, its your choice.

The most likely reason you can't login as root is the PermitRootLogin section in /etc/ssh/sshd_config is set to no.

Change that line to this:

PermitRootLogin Yes

then save the file and restart the ssh service, or the whole machine if you want.

I never allow root login though, and its ALWAYS the thing to turn off, view various guides online suggesting don't do it.
 
Old 09-15-2009, 03:35 AM   #9
Fin7PL
Member
 
Registered: Mar 2005
Location: Finland
Distribution: FreeBSD 9.0
Posts: 59

Rep: Reputation: 16
I thought that root login was denied as default in FBSD. I´m pretty sure about it.
 
Old 09-15-2009, 03:38 AM   #10
Fin7PL
Member
 
Registered: Mar 2005
Location: Finland
Distribution: FreeBSD 9.0
Posts: 59

Rep: Reputation: 16
Quote:
Originally Posted by manya View Post
I could login with normal user then su to become root via ssh using pw method, but there is no way by which we can allow root to access directly via ssh.
It should be Disabled by default, unless you have enabled it.

As Lee_ball informs, there´s way to Disable it again though.
 
Old 09-16-2009, 10:06 PM   #11
manya
Member
 
Registered: Apr 2004
Posts: 194

Original Poster
Rep: Reputation: 15
disabled, you mean for ssh service only or in pam. Because I could directly login on console that means root is not disabled only thing is I am not able to login via ssh.
And, even I tried doing su - but it says BAD Su for user xxxx
 
Old 09-17-2009, 01:21 AM   #12
Fin7PL
Member
 
Registered: Mar 2005
Location: Finland
Distribution: FreeBSD 9.0
Posts: 59

Rep: Reputation: 16
Yes i mean over ssh. What is your problem now exactly?

Using su ? or...


EDIT: Once again, in order to allow user "xxxx" use SU command succesfully, he has to be part of the wheel group.

EDIT2: Also the /var/log/auth.log would be nice.

Last edited by Fin7PL; 09-17-2009 at 01:36 AM.
 
Old 09-17-2009, 08:25 AM   #13
Lee_Ball
Member
 
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132

Rep: Reputation: 18
Quote:
Originally Posted by manya View Post
disabled, you mean for ssh service only or in pam. Because I could directly login on console that means root is not disabled only thing is I am not able to login via ssh.
And, even I tried doing su - but it says BAD Su for user xxxx
Hello Manya,

When you login at the console, you're not using SSH to login with so there is still a good chance its locked down.

I still think its a bad idea and using su to elevate privileges once logged in with a normal user account is always the way to go.

See here for examples of people suggesting lock it down:

http://blog.dbugs.org/2007/08/29/ssh-security/

http://www.wikihow.com/Secure-a-Linux-Server - See point 4



With regards to root logging in via ssh see this article:

http://www.ssh.com/.../Configuring_Root_Logins.html
 
Old 09-22-2009, 07:17 AM   #14
Lee_Ball
Member
 
Registered: Jul 2005
Location: Manchester (UK)
Distribution: Fedora CentOS
Posts: 132

Rep: Reputation: 18
Please see this recent news article regarding why being able to login as root is a baaaaadddd idea:

http://www.builderau.com.au/program/...9298642,00.htm
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Restricting SSH but allowing SCP mkono Linux - Server 2 06-03-2009 08:04 AM
machine not allowing login thru virtual console, only thru ssh dsids Linux - Newbie 2 01-15-2007 11:46 AM
Allowing root login to ssh only on LAN monkeyfoo Linux - Security 6 07-17-2006 09:42 PM
Is Allowing SSH Safe? Optimistic Linux - Security 10 03-21-2005 01:58 PM
Allowing for incoming ssh InsaneBob Linux - Software 11 04-12-2003 01:44 PM


All times are GMT -5. The time now is 07:37 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration