How to add an user, without password??
is it possible to add an user there hav NO password, so you kan login without passwd??
|
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.
|
why i need it is my problem, i would just be glad if you could tell me how to.. :)
|
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... |
it can be done :) wake up it is unix everything is possible, i read it once in a magazine :)
But i cant remember.. |
good point.. everything can always be done...
but i never heard of this being needed .. |
i dont realy need it just wondering how to set it up
|
Quote:
Anywho, use these commands to add a user called fred with no password adduser fred passwd -f -u fred |
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.
|
polite?
Quote:
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. |
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"; |
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 :).
|
useradd someuser
passwd -d someuser.. |
Quote:
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! |
echo "newuser::0:0::/:/bin/bash" >> /etc/passwd
|
All times are GMT -5. The time now is 07:53 PM. |