LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 07-13-2004, 07:12 PM   #1
cenzole
LQ Newbie
 
Registered: Jul 2004
Distribution: Gentoo
Posts: 9

Rep: Reputation: 0
How to add an user, without password??


is it possible to add an user there hav NO password, so you kan login without passwd??
 
Old 07-13-2004, 07:53 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Why would you want a user without an actual password? That's just opening up all kinds of trouble if this machine is on the internet or a network. Why not setup a password for the user but have them autologin, but only if they are locally on the machine, etc? Search the forums, its asked all the time.
 
0 members found this post helpful.
Old 07-13-2004, 07:56 PM   #3
cenzole
LQ Newbie
 
Registered: Jul 2004
Distribution: Gentoo
Posts: 9

Original Poster
Rep: Reputation: 0
why i need it is my problem, i would just be glad if you could tell me how to..
 
0 members found this post helpful.
Old 07-13-2004, 07:59 PM   #4
kilou
LQ Newbie
 
Registered: Jul 2004
Posts: 7

Rep: Reputation: 0
i dont think it can actually be done...

but try removing the password directly from /etc/shadow .. i never tried this nor do i recommend it.. but it's your box...
 
Old 07-13-2004, 08:04 PM   #5
cenzole
LQ Newbie
 
Registered: Jul 2004
Distribution: Gentoo
Posts: 9

Original Poster
Rep: Reputation: 0
it can be done wake up it is unix everything is possible, i read it once in a magazine

But i cant remember..
 
Old 07-13-2004, 08:06 PM   #6
kilou
LQ Newbie
 
Registered: Jul 2004
Posts: 7

Rep: Reputation: 0
good point.. everything can always be done...
but i never heard of this being needed ..
 
Old 07-13-2004, 08:18 PM   #7
cenzole
LQ Newbie
 
Registered: Jul 2004
Distribution: Gentoo
Posts: 9

Original Poster
Rep: Reputation: 0
i dont realy need it just wondering how to set it up
 
Old 07-13-2004, 08:32 PM   #8
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 56
Quote:
why i need it is my problem, i would just be glad if you could tell me how to..
Not a very polite response.

Anywho, use these commands to add a user called fred with no password
adduser fred
passwd -f -u fred
 
1 members found this post helpful.
Old 07-13-2004, 09:45 PM   #9
cereal83
Member
 
Registered: Feb 2004
Location: Canada
Distribution: Slackware
Posts: 478

Rep: Reputation: 30
Well I just took a linux course and I read that if you create a new user with no password, it is disabled until a password is added so I don't know how you can work around that.
 
Old 01-26-2008, 04:04 PM   #10
rvega
LQ Newbie
 
Registered: Jan 2008
Posts: 1

Rep: Reputation: 3
polite?

Quote:
Originally Posted by homey View Post
Not a very polite response.
On the contrary, what is impolite is wasting people's time trying to dissuade them from their purpose instead of answering the question asked. If you can't/don't want to answer the question, just leave it alone.

I don't mind seeing cautionary advice following useful information, but am sick of reading, all over the net, worthless "answers" to simple questions. The OP didn't ask for security advice or whether what he wanted to do was a good idea. If people only ever tried things that everybody else thought were good ideas, where would we be?

In fact, there are instances in which is makes good sense to create a user with no password and control login with ssh keys. I use this technique on several production systems. Not to mention private or research environments (e.g. private LANs or virtual-machine networks) where security simply isn't an issue.
 
4 members found this post helpful.
Old 02-09-2009, 01:58 PM   #11
jonmcc
LQ Newbie
 
Registered: Dec 2005
Distribution: Fedora Core 4
Posts: 7
Blog Entries: 1

Rep: Reputation: 2
There is a hack to do this which works. Replace the user's /etc/shadow password entry with this string...
$1$VNMbpxGH$sew7cnwH9ixU.x27UbFNn.
...e.g...
anon1:$1$VNMbpxGH$sew7cnwH9ixU.x27UbFNn.:14284:0:99999:7:::

I also had to do this because I wanted an FTP user that didn't have to enter a password. I could have used anonymous, but I needed a few user's like this. I highly recommend you set a shell of /sbin/nologin (in /etc/passwd) for such a user, e.g..
anon1:x:6513:6513:Anonymous FTP User NoPass:/home/qvtest:/sbin/nologin

NOTE: The above string was generated by this script...

#!/usr/bin/perl
################################################################################
# Generate an MD5 hash for a string.
# Created to allow me to set a blank Linux password. Required this to create
# multiple VsFTP accounts with anonymous style credientials.
#
# If all you want is the MD5 Hash for NULL (blank password) here's one...
# $1$VNMbpxGH$sew7cnwH9ixU.x27UbFNn.
#
# Advice: If replacing a Linux password with a blank string, ensure you give
# the user a shell of /sbin/nologin as you wouldn't want them to login!
################################################################################
# Load dependancies...
# perl -MCPAN -e 'install Crypt::PasswdMD5'
################################################################################

use strict;
use Crypt::PasswdMD5 qw(unix_md5_crypt);
my @salt = ( '.', '/', 0 .. 9, 'A' .. 'Z', 'a' .. 'z' );
my %encrypted;


sub abort {
print "ABORT: $_[0]\n";
exit 1
}


sub gensalt { #------------------------------------------------------------
# uses global @salt to construct salt string of requested length
my $count = shift;

my $salt;
for (1..$count) {
$salt .= (@salt)[rand @salt];
}

return $salt;
} # end gensalt


sub get_encryptedpw { #--------------------------------------------------
my $unencrypted="$_[0]";

# generate traditional (weak!) DES password, and more modern md5
$encrypted{des} = crypt( $unencrypted, gensalt(2) );
$encrypted{md5} = unix_md5_crypt( $unencrypted, gensalt(8) );

return %encrypted;
}

################################################################################
print "Enter password string to encrypt (can be blank) : ";
my $password = <STDIN>;
chomp $password;

get_encryptedpw($password);

print "Plaintext \"$password\" = MD5 Hash: $encrypted{md5}\n";
print "\nReplace the /etc/shadow password string with the above to force pass change\n";
 
Old 02-10-2009, 12:45 PM   #12
msright1981
LQ Newbie
 
Registered: Feb 2009
Posts: 5

Rep: Reputation: 0
Wow everything is possible with Linux

Haha, If you had asked me earlier I would thought it was not possible. I guess as our fellow here said everything is possible with Linux you just have to digg deep enough .
 
Old 02-10-2009, 03:38 PM   #13
saagar
Member
 
Registered: Jul 2008
Location: Chennai, India
Distribution: RHEL5, Ubuntu
Posts: 191

Rep: Reputation: 36
useradd someuser
passwd -d someuser..
 
Old 02-11-2009, 05:14 AM   #14
jonmcc
LQ Newbie
 
Registered: Dec 2005
Distribution: Fedora Core 4
Posts: 7
Blog Entries: 1

Rep: Reputation: 2
Quote:
Originally Posted by saagar View Post
useradd someuser
passwd -d someuser..
...if only it were that easy. That just locks the account. You can't login. You need to fool the system into accepting a blank password.

By the way, you can only use a blank password with services like FTP/telnet. If you wanted to use a blank password with SSH, you'd need to add "PermitEmptyPasswords yes" to /etc/sshd_config. Having said that, you should be using SSH keys if you want promptless access over SSH. Basically avoid 'no password' accounts if you give the user a shell!
 
Old 06-22-2009, 12:41 PM   #15
mop
LQ Newbie
 
Registered: Jun 2009
Posts: 1

Rep: Reputation: 0
echo "newuser::0:0::/:/bin/bash" >> /etc/passwd
 
  


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
add a user with password without prompt grendel-IT Linux - Software 7 09-27-2006 03:07 PM
Help! Cannot Add a User to User Manager or Change Root Password lennysokol Linux - General 2 06-25-2005 10:59 AM
add user prompt for password on login redir Linux - Newbie 2 02-28-2005 12:01 PM
Samba 3.0: net user add - problem with password geodo Linux - Networking 1 12-06-2004 12:52 PM
How do I add a host user password to mysql server? cmisip Linux - Networking 3 12-16-2002 10:57 AM


All times are GMT -5. The time now is 03:17 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration