Debian: useradd –p encrypted password is not working on Sarge
Well I am having really frustrating issue with the Sarge which I have installed on the computer of mine. I am trying to add the user by using the following command.
Code:
useradd test2 -g labels -m -d /home/labels/test2 -s /bin/sh -p $1$FaOtejz7$4BbqatyzZ6AZ0WQHV1xlv
I am able to add the user by using the above mentioned command however the password is not working at all. Let me know if you are having any specific solution to fix the matter of mine. Thanks a lot in advance.
re: Debian: useradd –p encrypted password is not working on Sarge
I am suggesting following solution and it would only work if you are going to create a new account on the computer. Well I you should run the following command on the terminal.
after using the above mentioned command you will be able to set the password on the computer of yours.
re: Debian: useradd –p encrypted password is not working on Sarge
I think I have figure out the root cause of the problem which you are getting and you can use the following instruction to resolve the matter. Well you cannot use –m and –d option together on the computer. You should use –m or –d option on the command and see whether it is working or not. So you should try to fix the matter of yours and let me know whether it is working or not.
re: Debian: useradd –p encrypted password is not working on Sarge
Well looking at the situation which you have mentioned over here I am suggesting following thing which you can use to fix the matter of yours. you should run the following command on the terminal.
once you have add the group label into the mkdir /home/labels. Now you should run the command which you have mentioned on the question I am hoping that it would be useful to you.
re: Debian: useradd –p encrypted password is not working on Sarge
I am suggesting following script which you should run on the terminal and see whether it is working or not.
Code:
$crypthash = crypt($_POST['label_pass']);
$outputFilesystem =
shell_exec('sudo useradd '.$labelusername.' -g labels -m -d /home/labels/'.$safeLabelName.' -s /bin/sh -p '.$crypthash);
I have already used the above mentioned script and it really worked for me.
re: Debian: useradd –p encrypted password is not working on Sarge
I am suspecting that the encrypted password which you have used is quite big. I am suggesting following script which you can run.
Code:
#!/usr/bin/python2.4
# -*- coding: latin1 -*-
#
import crypt
import random
import string
def getsalt(chars = string.letters + string.digits):
return random.choice(chars) + random.choice(chars)
print crypt.crypt("testuserpass" , getsalt())
I think you need to install the following module on the computer.
apt-get install python-crypto
so try the same and let me know whether it is working or not.