LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   User Account without a Password (https://www.linuxquestions.org/questions/linux-server-73/user-account-without-a-password-852972/)

devUnix 12-29-2010 02:47 AM

User Account without a Password
 
How to allow a user to login without entering a password?

If my question sounds wierd then check out m-net at www.arbornet.org/m-net.php and see how it works.

Telnet / SSH to m-net.arbornet.org and type in newuser and it won't prompt for a password.

Any ideas?

acid_kewpie 12-29-2010 03:02 AM

just delete their password: passwd -d

Reuti 12-30-2010 04:14 AM

Why do you want to do so? Using SSH with an ssh-agent wouldn't be an option? Anyway, besides removing the password entry in /etc/shadow, it might also be necessary to adjust in one file in /etc/pam.d to be sure that:

auth required pam_unix2.so nullok

has the nullok option.

acid_kewpie 12-30-2010 04:26 AM

well I can see reasons, especially with an account called "newuser"... if it's by extreme exception, and the account is tied to well written provisioning scripts then fine.

Aneeshvm123 12-30-2010 06:38 AM

If you want to remove password of a user you can use passwd -d <username>.

Regards,
Aneesh V.M

acid_kewpie 12-30-2010 06:43 AM

Quote:

Originally Posted by Aneeshvm123 (Post 4207655)
If you want to remove password of a user you can use passwd -d <username>.

Regards,
Aneesh V.M

Been there, said that. ;-)

devUnix 01-04-2011 02:56 PM

Quote:

Originally Posted by acid_kewpie (Post 4207658)
Been there, said that. ;-)



I created a user demo and assigned a default password to it. On a different terminal logged in using the login name demo and supplied the password. Things went fine as they would.

To enable the user demo login without entering the password, I did what you said:

Code:

-bash-2.05b# passwd -d demo
Removing password for user demo.
passwd: Success
-bash-2.05b#

I am still required to enter the password:

Code:

login as: demo
demo@linuxzoo.net's password:
[demo@host-6-121 demo]$

and am able to login.

I don't want any password for the user "demo" so that it can login without any password.

I am not familiar with the PAM thing.

Reuti 01-04-2011 03:50 PM

The PAM thing we have to adjust later. It should simply refuse login for empty passwords by default - although it asks for one, it will always deny access. You are on which OS in detail?

What is the entry for your demo user in /etc/shadow? Are you using NIS, where the old password setting might be still be in it's database (and so removing the password wouldn't act instantly)?

devUnix 01-05-2011 06:53 AM

Quote:

Originally Posted by Reuti (Post 4213196)
You are on which OS in detail?

Code:

-bash-2.05b# uname -a
Linux host-6-113.linuxzoo.net 2.6.18.1 #5 Thu Nov 30 12:51:52 GMT 2006 i686 i686 i386 GNU/Linux
-bash-2.05b# cat /etc/issue
Fedora Core release 2 (Tettnang)
Kernel \r on an \m

Quote:

What is the entry for your demo user in /etc/shadow?
Code:


-bash-2.05b# grep ^demo /etc/passwd
demo:x:500:500::/home/demo:/bin/bash
-bash-2.05b# grep ^demo /etc/shadow
demo::14978:0:99999:7:::
-bash-2.05b#

Quote:

Are you using NIS, where the old password setting might be still be in it's database (and so removing the password wouldn't act instantly)?
Code:

No. It is the same server / system.

Reuti 01-05-2011 07:39 AM

When I get you right: it's still asking for a password and you get access by entering the last known one, despite the fact that you deleted the password in the meantime - correct?

NIS can also operate local, do you have something like /var/yp/ ?


All times are GMT -5. The time now is 10:02 PM.