Bläddra i källkod

Indicate how to make dovecot and znc password hashes in Python

Solves the chicken-or-the-egg problem of generating a dovecot and znc salted
password hash without already having dovecot and znc installed. That is, people
are installing sovereign typically do not have dovecot and znc installed and
have no way of generating the required salted password hashes.

Python 3 standard library generates SHA512-CRYPT salted password hashes by
default so it is particularly convenient for configuring dovecot:

    python3 -c 'import crypt; print(crypt.crypt('password'))'

For ZNC, the required command is slightly more verbose.
Allen Riddell 10 år sedan
förälder
incheckning
1bfeb1f3e0
1 ändrade filer med 8 tillägg och 0 borttagningar
  1. 8
    0
      README.textile

+ 8
- 0
README.textile Visa fil

140
 
140
 
141
 Remove @{SHA512-CRYPT}@ and insert the rest as the @password_hash@ value.
141
 Remove @{SHA512-CRYPT}@ and insert the rest as the @password_hash@ value.
142
 
142
 
143
+Alternatively, if you don't already have @doveadm@ installed, Python will generate the appropriate string for you (assuming your password is @password@):
144
+
145
+bc. python3 -c 'import crypt; print(crypt.crypt("password"))'
146
+
143
 Same for the IRC password hash...
147
 Same for the IRC password hash...
144
 
148
 
145
 bc. # znc --makepass
149
 bc. # znc --makepass
150
 
154
 
151
 Take the string beginning with @sha256#@ and insert it as the value for @irc_password_hash@.
155
 Take the string beginning with @sha256#@ and insert it as the value for @irc_password_hash@.
152
 
156
 
157
+Alternatively, if you don't already have @znc@ installed, Python will generate the appropriate string for you:
158
+
159
+bc. python3 -c 'import crypt; salt, hash = crypt.crypt("password", crypt.mksalt(crypt.METHOD_SHA256)).split("$")[2:]; print("sha256#{}#{}".format(hash, salt))'
160
+
153
 For git hosting, copy your public key into place. @cp ~/.ssh/id_rsa.pub roles/git/files/gitolite.pub@ or similar.
161
 For git hosting, copy your public key into place. @cp ~/.ssh/id_rsa.pub roles/git/files/gitolite.pub@ or similar.
154
 
162
 
155
 Finally, replace the TODOs in the file @hosts@. If your SSH daemon listens on a non-standard port, add a colon and the port number after the IP address.
163
 Finally, replace the TODOs in the file @hosts@. If your SSH daemon listens on a non-standard port, add a colon and the port number after the IP address.

Laddar…
Avbryt
Spara