LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 11-15-2005, 06:00 AM   #1
paddyjoy
Member
 
Registered: Apr 2005
Location: Sydney
Distribution: FC5
Posts: 174

Rep: Reputation: 30
Default passwords for users


I was just looking at my /etc/passwd file and from what I can gather, some users are allowed to logon to a shell
Code:
paddy:x:500:500:Paddy Joy:/home/paddy:/bin/bash
and some are not
Code:
apache:x:48:48:Apache:/var/www:/sbin/nologin
Is this correct?

If so what are the default passwords of all the users that can log in to a shell?
Code:
[root@paddy ~]# cat /etc/passwd | grep bash
root:x:0:0:root:/root:/bin/bash
netdump:x:34:34:Network Crash Dump user:/var/crash:/bin/bash
pvm:x:24:24::/usr/share/pvm3:/bin/bash
mysql:x:27:27:MySQL Server:/var/lib/mysql:/bin/bash
amanda:x:33:6:Amanda user:/var/lib/amanda:/bin/bash
postgres:x:26:26:PostgreSQL Server:/var/lib/pgsql:/bin/bash
paddy:x:500:500:Paddy Joy:/home/paddy:/bin/bash

Paddy
 
Old 11-15-2005, 07:26 AM   #2
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
I don't know the default password. But in fact you don't need to know You can "su" from the root account to the one you need to log into.

Yves.
 
Old 11-15-2005, 07:27 AM   #3
theYinYeti
Senior Member
 
Registered: Jul 2004
Location: France
Distribution: Arch Linux
Posts: 1,897

Rep: Reputation: 66
BTW, once logged in as either root or a given "user", it is easy to change this "user"'s passwork.

Yves.
 
Old 11-15-2005, 02:30 PM   #4
paddyjoy
Member
 
Registered: Apr 2005
Location: Sydney
Distribution: FC5
Posts: 174

Original Poster
Rep: Reputation: 30
Thanks, couldn't someone just log onto my system as user mysql or netdump if they knew the default password FC4 had set up during installation?
 
Old 11-16-2005, 01:30 AM   #5
int0x80
Member
 
Registered: Sep 2002
Posts: 310

Rep: Reputation: Disabled
Potentially, but if you check your /etc/shadow file (assuming you are using shadow passwords), you should see that most of these accounts do not have passwords. Your safest best, afaik, is to set all non-user accounts (eg: apache, irc, man, etc.) to use /dev/null instead of /bin/sh or other. Make sure you also have /dev/null listed in your /etc/shells file. Here is what my (snipped) /etc/passwd looks like:

# cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/dev/null
bin:x:2:2:bin:/bin:/dev/null
nobody:x:65534:65534:nobody:/nonexistent:/dev/null
david:x:1000:1000:,,,:/home/david:/bin/bash
sshd:x:100:65534::/var/run/sshd:/dev/null
 
Old 11-16-2005, 02:56 AM   #6
paddyjoy
Member
 
Registered: Apr 2005
Location: Sydney
Distribution: FC5
Posts: 174

Original Poster
Rep: Reputation: 30
So if there is no password in /etc/shadow the user can't log in?

Paddy
 
Old 11-16-2005, 07:00 AM   #7
int0x80
Member
 
Registered: Sep 2002
Posts: 310

Rep: Reputation: Disabled
Quote:
Originally posted by paddyjoy
So if there is no password in /etc/shadow the user can't log in?

Paddy
False. If your mysql user has a shell of /bin/sh, and I exploit mysql with shell code that executes /bin/sh, then I get dropped into a shell as mysql. Therefore I am logged in as mysql, even though the user mysql has no password.
 
Old 11-17-2005, 03:30 AM   #8
paddyjoy
Member
 
Registered: Apr 2005
Location: Sydney
Distribution: FC5
Posts: 174

Original Poster
Rep: Reputation: 30
Thanks, I think the safest thing to do is to set all the users to /sbin/nolgin except for the ones I want to allow login. I was just worried coz I get so many script kiddies hitting my server trying to log in as users like mysql, postgresql etc. . . . . .
 
  


Reply



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
Default Root Passwords? Pauli Linux - General 7 09-01-2005 11:35 AM
remove passwords from all users? paul_mat Linux - Networking 2 06-23-2005 05:59 PM
Help with users and passwords???? graystarr Linux - Software 3 04-21-2003 09:40 AM
group passwords + default chosmer Linux - Security 1 07-01-2002 02:05 PM
users/passwords scipts Anthony Programming 1 03-27-2002 07:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 01:23 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration