hamstar / Braincase

A personal knowledge base system for expansion of the mind in a virtual space.
4 stars 1 forks source link

Password for the linux user needs to be set #262

Closed hamstar closed 12 years ago

hamstar commented 12 years ago

This currently does not happen. It should be implemented in the user sync script and be set the same as the password specified in the email that is sent to the user.

We will need to consider how #244 works in this context as the dokuwiki password can be gained from there.

hamstar commented 12 years ago

I have done some research on how this can be done. We need to use a crypt command to encrypt a plaintext password and specify it at the point of user creation or using passwd --stdin.

Since openssl will be installed anyway we can use the command openssl passwd PASSWORD to encrypt passwords.

bhavicp commented 12 years ago

Has this been completed? I had a look at the commit https://github.com/hamstar/Braincase/commit/0d3a9daa74219258b7b73f8c2815a4e90bf08ff3, But I didn't see anything relevant.

hamstar commented 12 years ago

Yes its currently in the dokumailhalt branch (see user.rb or b72b360f) but I haven't noted it here yet because it needs to be properly tested before being merged into the sprint3 (or sprint4) branch. I will reference this issue when that branch is merged into the main one.

Could be tested like this:

$ irb
irb> require 'usr/share/braincase/lib/braincase/user'
irb> require 'usr/share/braincase/lib/braincase/utils'
irb> u = Braincase::User.new "test"
irb> u.set_password "my password"
irb> exit
$ su test
Password: <enter new password>

If it logs in OK then it worked :)