LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-16-2018, 04:24 AM   #1
arahmancsd
LQ Newbie
 
Registered: Nov 2018
Posts: 10

Rep: Reputation: Disabled
Allow login with password only


I am amazed to see that I can login using some default users like www-data, mysql etc with/out password in linux. How can I allow login with correct password only? and some default users should note to be able login.
My OS
Linux friend 3.2.0-4-686-pae #1 SMP Debian 3.2.96-2 i686 GNU/Linux
 
Old 11-16-2018, 06:59 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,251

Rep: Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321Reputation: 2321
You can log in with user nobody also. If you set a password for mysql, that will stop, but so might mysql

A better way to go if you're excited about it is to limit what user mysql can do. The guy who did qmail set up users with a shell of '/bin/true' which isn't much use to a hacker
 
Old 11-16-2018, 09:00 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,674

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
By default system users like www-data and nobody are disabled and you should not be able to login. It is possible to use su or sudo to become a system user which is something different.

How are you logging in to www-data with/out password?
 
Old 11-16-2018, 10:16 AM   #4
arahmancsd
LQ Newbie
 
Registered: Nov 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
By default system users like www-data and nobody are disabled and you should not be able to login. It is possible to use su or sudo to become a system user which is something different.

How are you logging in to www-data with/out password?
Thanks, I can login using www-data, root with invalid / incorrect password. I am really confused why it has to login with incorrect password though? when I login with www-data, the shell appears "You have mail" $
Also, when doing ssh, if I enter wrong password for root it enters which shouldn't.

Last edited by arahmancsd; 11-16-2018 at 10:29 AM.
 
Old 11-16-2018, 11:22 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,674

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
Can you post the lines /etc/passwd and /etc/shadow for www-data?
 
Old 11-16-2018, 12:15 PM   #6
arahmancsd
LQ Newbie
 
Registered: Nov 2018
Posts: 10

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Can you post the lines /etc/passwd and /etc/shadow for www-data?
Thanks, here you are;
passwd
www-data:x:33:33:www-data:/var/www:/bin/sh
shadow
www-data:*:17108:0:99999:7:::
 
Old 11-16-2018, 01:49 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,674

Rep: Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892Reputation: 5892
Although you state the distribution is debian you have not fully described how it is configured nor how you are actually are logging in as www-data with or without a password.

Quote:
www-data:*:17108:0:99999:7:::
Accounts with an * are disabled for login and have never had a password.
 
Old 11-16-2018, 03:16 PM   #8
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.9.2009
Posts: 5,722

Rep: Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210Reputation: 2210
On my CentOS system, I've configured the system users (and mail-only users, for that matter) with /sbin/nologin as the login shell. Even root can't su to those:
Code:
# su someuser
This account is currently not available.
I, too, am curious by what the OP means when they say login...in a terminal, at the console, on a desktop, using su?
Which?
 
  


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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to find Administrators password does not recognize my login password the only password I entered at setup of Linux scholarsgold Linux - Newbie 6 01-23-2018 03:58 PM
allow ssh only with key file and password ravibhure Linux - Newbie 4 07-12-2010 01:53 PM
[SOLVED] Using hosts.allow to allow only postfix to use port 25 Mogget Linux - Server 3 03-28-2009 04:36 AM
hosts.allow file to allow only a single IP sailu_mvn Linux - Networking 2 06-06-2007 11:47 PM
Is it possible to have only 1 user signed in at a time or only allow console Sign Ins adamrau Linux - Security 5 11-19-2001 02:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

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