htpasswd & bash_history

Alles, was den Apache betrifft, kann hier besprochen werden.

htpasswd & bash_history

Postby maren » 08. April 2017 12:31

Hallo,

in Apache 2.2 wird beim Erstellen eines Passworts per Shell-Befehl das Passwort blank in die .bash_history Datei geschrieben. Es finden sich also alle erstellten Passwörter in blank mit zugehörigem Usernamen in der .bash_history Datei.

Es scheint keine Flag für das Unterbinden des Abspeicherns in die .bash_history Datei zu geben.

Code: Select all
Usage:
        htpasswd [-cmdpsD] passwordfile username
        htpasswd -b[cmdpsD] passwordfile username password

        htpasswd -n[mdps] username
        htpasswd -nb[mdps] username password
 -c  Create a new file.
 -n  Don't update file; display results on stdout.
 -m  Force MD5 encryption of the password.
 -d  Force CRYPT encryption of the password (default).
 -p  Do not encrypt the password (plaintext).
 -s  Force SHA encryption of the password.
 -b  Use the password from the command line rather than prompting for it.
 -D  Delete the specified user.
On Windows, NetWare and TPF systems the '-m' flag is used by default.
On all other systems, the '-p' flag will probably not work.


Einerseits ist es "logisch", dass der Befehl in der .bash_history Datei landet, andererseits unlogisch, dass das Passwort somit "unverschlüsselt" abgespeichert wird, was mit dem Befehl verhindert werden sollte.

Es bestehen drei Möglichkeiten:

1.) bash_history deaktivieren. (heißt: komplett auf bash_history verzichten)
2.) nachträglich die bash_history komplett leeren.
3.) nachträglich die bash_history editieren.

Fazit: entweder Verzicht oder zusätzlicher Aufwand.
maren
 
Posts: 1
Joined: 08. April 2017 12:18
XAMPP version: 2.2.15
Operating System: Linux

Re: htpasswd & bash_history

Postby Nobbie » 09. April 2017 00:43

Ja, und?
Nobbie
 
Posts: 13183
Joined: 09. March 2008 13:04

Re: htpasswd & bash_history

Postby lexaiden » 18. April 2017 21:23

Hä? Schreib halt Dein Passwort nicht mit in die Befehlszeile! Mit dem Befehl...

htpasswd passwordfile username

...fragt das Programm nach dem Passwort, so wird es auch nicht in der bash_history geloggt.
lexaiden
 
Posts: 10
Joined: 14. August 2004 22:58
XAMPP version: apache 2.4.25-1
Operating System: Linux Arch


Return to Apache

Who is online

Users browsing this forum: No registered users and 25 guests