mirror of
https://github.com/openwall/john.git
synced 2026-12-03 18:45:21 +07:00
[GH-ISSUE #2820] INSTALL-UBUNTU should explicitly state it's about user-local build #1807
Labels
No labels
bug
core branch
documentation
enhancement
enhancement
fixed - pending verify
fuzz bug
good first issue
invalid
invalid
maintenance/cleanup
new cracking mode
new format
new tool
non-trivial
notes/external issues
portability
question
RFC / discussion
testing
WONTFIX
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
openwall/john#1807
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Oct 19, 2017).
Original GitHub issue: https://github.com/openwall/john/issues/2820
I get
john.log: Permission deniedwhen running as a user. This is the basic test session:There is no mention of this log file in the man page or in
/usr/share/doc/john/CONFIG. It appears the executable is making bad assumptions, like that it has write access in the directory where the executable sits. IMO it would be bad security for users to have write permission there.As an experiment, I added
/usr/local/src/john/runto the user's$PATHand ranjohnwithout a directory prefix. It still fails, but for a different reason:This is a new installation where root took these actions to install on a Debian Stretch system (following the
doc/INSTALL-UBUNTUinstructions):Installation was error-free AFAIK, and the
$ ../run/john --test=0test passed.System configuration
Attach details about your OS and about JtR, including:
I believe so.. used the
-b bleeding-jumbooption.$ john --list=build-info.$ john --list=opencl-devices(if applicable).@magnumripper commented on GitHub (Oct 19, 2017):
This is not a support forum. Try the john-users mailing list.
@magnumripper commented on GitHub (Oct 19, 2017):
I'll give you a hint though: try
which johnand go figure.@ghost commented on GitHub (Oct 20, 2017):
which johngives/usr/local/src/john/run/john, which (as expected) this is what was built. It's unclear how that explains thefopen: $JOHN/john.ini: No such file or directoryerror.I'm baffled that you aren't seeing the bugs. I've counted 10 bugs so far in the above scenario. Bug reports are created when software does not work as documented. If you believe the software is working correctly, then the documentation is defective. Even if you are ignoring the documentation factor, at least one of the bugs is most certainly a software bug. Here's an enumeration of what I've encountered so far:
(bug 1) Running <absolute path>/
johnwithout having the path in the$PATHvariable is an allowable way to execute something on linux, yet it causesjohnto attempt to write to a directory it does not have write permission on. No such limitation is documented forjohn. In fact, the first question in/usr/share/doc/john/FAQstates that it is supported to prefix a path to the executable. Apparently absence of the$JOHNvariable leads to the software making an undocumented guess at what$JOHNshould be set to. Even if it were documented, this fails the test of least astonishment. That is, experienced users would find it astonishing that a tool expects to have write access to the location where to tool itself is stored.(bug 2) There is no man page for
gpg2john(and i do stress that this is a bug not an enhancement under the paradigm that software do what it's documented to do and that documentation states what the software does)(bug 3) When executed using the
$PATH(thus without a path prefix),johnfails to find a file because it expects a shell variable$JOHNto be populated, yet there is no mention of that precondition in theman johnpages. Since this is documented in theREADME, I'll call this an enhancement, but it should appear in the man page as well in a section titledENVIRONMENT.(bug 4 [w/3 sub-bugs]) The basename of the file sought in item 3 (above) is
john.ini. It's not only bizarre that this file would be expected on a UNIX-like system, it's also documented in/usr/share/doc/john/CONFIGthat the filename isjohn.conf. In fact, it's doubly documented as such, because the USAGE section ofman johnstates(configurable in the configuration file, ~/.john/john.ini or ~/.john/john.conf ), with the latter being the convention on linux. The FILES section ofman johncontradicts all, and states that the config file is expected to be/etc/john/john.conf. So there's a clear discrepancy between the documentation and the software. In this case, defects are actually in both the software and the documentation. Software bug 4.1: convention favors.confon UNIX-like systems, while the tool looks forjohn.ini. Software bug 4.2: the tool is expecting to find a config file in$JOHN, but the docs point to two different places, neither of which refer to$JOHN. Doc bug 4.3: it's documented inconsistently. Perhaps the intent of the tool is to look at both~/.john/john.confand/etc/john/john.conf, in which case both should be in the FILES section ofman john. Doc bug 4.4: the modern-day convention is to put user config files in~/.config/, so an enhancement jtr should standardize.(bug 5) Use of
$JOHNappears in/etc/john/john.conf. TheCONFIGdoc does not state that environment variables may be used in the configuration file. Is$JOHNinterpreted as a special undocumented instance of one environment variable that is exceptionally permitted in the config file, or are all $-prefixed strings that occur to the RHS of an assignment in that file interpreted as environment variables? Users of UNIX-like systems have no natural expectation that they may reference an environmental variable in the config file of a tool, so when it is the case it should be documented as such.(bug 6) [enhancement] The
$JOHNvariable should not even exist. Software normally installs all resources that it needs in conventional locations, and then looks in those locations automatically at execution time. Even if I'm overlooking something that complicates removal of$JOHN, the conventional place to define such a parameter is in the config file, if the parameter must exist.(bug 7) The github bug report template directs users to run
john --list=build-infoandjohn --list=opencl-devices, which were unknown commandline options when I ran them initially. It worked for me now when I just repeated it, and it's unclear why. Perhaps it can be reproduced by someone followingINSTALL-UBUNTUas I did, and not going further to hack things to make it work.(bug 8) [enhancement] The existence of
INSTALL-UBUNTUand omission of a Debian procedure is misleading and overly specific. A guide for Ubuntu implies that it will require Ubuntu-specific procedures like adding a PPA. Debian is the core parent distribution for which Ubuntu, Mint, and many others are based off. Since the procedure works for a pure and proper Debian system, occurrences of the word "Ubuntu" should be replaced with "Debian".@kholia commented on GitHub (Oct 20, 2017):
In your report, I don't see where
gpg2johnis trying to write to a directory it does not have write permissions on. Can you please point out the spot to me?Also, lot of your other comments somehow sound off to me.
HINT: Instead of trying to "install" JtR jumbo on your system, just build it, and use it as-it-is from a local directory as a non-root user.
@ghost commented on GitHub (Oct 20, 2017):
Sorry, it was
johnthat has that problem. I'll correct that in the post.@frank-dittrich commented on GitHub (Oct 20, 2017):
Where does doc/INSTALL-UBUNTU mention you are supposed to run commands as root?
If you want a system-wide installation, you might want to check
./configure --helpand then try the option--with-systemwide.BTW, I agree with @magnumripper .
Your questions would have been more appropriate in the john-users mailing list.
@ghost commented on GitHub (Oct 20, 2017):
There are a number of
sudos that do not specify a user, which by default execute as root. Of course I deviated and rangit cloneas root in/usr/local/srcbecause that's a linux convention for a systemwide installs in the absence of a.debpackage.Ah, thanks. Having a user unpack a release in
$HOMEwith intent to execute a systemwide install isn't a standard practice. Indeed I needed to be told that. This inspires an enhancement to amend to the bug list:(bug 9) Unconventional systemwide install procedure is under-documented. Because conventions are deviated from, it's important that doc/INSTALL-UBUNTU hilight the
--with-systemwideparameter, and the fact that a normal user must take this action in$HOME. The status quo is effectively a gotcha for admins who don't run the (undocumented)./configure --helpcommand.These are bug reports and intended as such. Correct and diligent documentation is how PEBCAKs are mitigated. It's good to have support in mailing-lists, usenet, and IRC, but if lacking documentation triggers that support it's already needlessly labor intensive for everyone involved.
@kholia commented on GitHub (Oct 20, 2017):
@libBletchley It would be great if you could also post patches (PRs) to address the various bugs / enhancements you point out. Doing so shouldn't be too hard (for many cases), and from your posts it seems that you really care about these issues. I would love to see better, foolproof documentation.
@ghost commented on GitHub (Oct 20, 2017):
@kholia Indeed I was considering that. They're probably good entry-level bugs. I'll of course have to reach a point where things are working so the contributions I make are verified to some extent.
I just repeated the installation process using the systemwide variation as a user (suggested by @frank-dittrich) and although I noticed no errors, the test doesn't work. This time running
tools/src/john/run/john --test=0from/home/alicedoesn't work -- it causesfopen: $JOHN/john.ini: No such file or directory(with$JOHNnow being derived as/usr/share/john/). Note that I still deviated from the procedure by rooting JTR in$HOME/tools/srcinstead of$HOME/src, which I would have hoped is innocent enough. I was astonished that./configure --with-systemwidedid not prompt for an admin password, and that (apparently) all users on the system must have access to/home/alice/tools/src/run(Alice's personal space) in order to use JTR. Maybe I'm missing something, but I don't think there was even an attempt to write to/usr/localor/opt.My conjecture is that
--with-systemwidehas a side-effect of putting$JOHNin a location where the config file isn't looked for, and it doesn't bother to look for/etc/john/john.conf. So users must manually copy/create a config file, and note that the location in/etc/mentioned in the man page is unused.BTW the missing
john.iniis just a bad error message. I can see from usingstrace -e openthatjohnis looking first for a non-existent$JOHN/john.conf, and only prints the last place it looks.@ghost commented on GitHub (Oct 20, 2017):
In the bug report, you were NOT using bleeding-jumbo. You have an ancient John the Ripper installed in your system.
Ops, it is not bleeding. But, you are right I'll change the template and add the ../run to john [...] command line.
@ghost commented on GitHub (Oct 20, 2017):
You were fooled by the system installed package. So:
From "JtR man page" (notice the DOES NOT):
There are a reason:
--system-wideor to need write permissions to john/run/john.log;For sure the documentation is not as good as it should, and the
fopenerror message can be confusing, but you are trying to create a system wide build without following all required steps.@ghost commented on GitHub (Oct 20, 2017):
Now that
--list=build-infoworks, I can see that I initially installed this version in /usr/local/:Version: 1.8.0-jumbo-1-5954-gbf9a37bd9and this version in$HOME:Version: 1.8.0-jumbo-1-5955-g46b200f8cI'm surprised
git clonewould give me an ancient version.@ghost commented on GitHub (Oct 20, 2017):
@frank-dittrich stressed that I should follow the doc and run everything as a user. I'm not sure what steps you're saying I missed, but I'm getting the impression that perhaps I was right the first time in running in
/usr/local/srcwith admin rights, but that I should also include the--with-systemwideoption. I might try that on the 3rd install attempt.Should I omit
-b bleeding-jumbofrom this:$
git clone git://github.com/magnumripper/JohnTheRipper -b bleeding-jumbo john? Is that what gave me an ancient version?
@ghost commented on GitHub (Oct 20, 2017):
All of us (plus the maintainer) welcome you, of course. And ANYONE else. But, take your time!
On the contrary. E.g. (IMO):
NEVER. The procedure was tested and works for Ubuntu. It might work unchanged on Debian (untested) and with modifications on Fedora.
That said, this is a invalid bug report.
@ghost commented on GitHub (Oct 20, 2017):
[edited]
Since you have john man page installed, you have an ancient package installed in your system. Are you sure $PATH was not selecting it?
Have you read README-DISTROS? Have you set JOHN_SYSTEMWIDE_EXEC and JOHN_SYSTEMWIDE_HOME?
It depends. Never, if you want to build bleeding. And you do.
You might have cloned john proper.
Now notice that we are not being intransigent. These are welcomed questions for a support forum, but not on a bug tracker.
@solardiz commented on GitHub (Oct 20, 2017):
Here are some assorted thoughts:
Originally, JtR was not meant to be "installed" at all. You'd build and run it in a subdirectory under your user account's home directory. That's how I still use it almost all of the time, and what I recommend that others do. That's why the paths relative to
johnbinary and assumption that this specific directory is writable by the same user, except in system-wide builds:Some years ago, I added system-wide installation support for packaging JtR by distros. I never intended this to be used other than by distros. I continue to recommend against use of this functionality other than by distros.
Given the statements above, I recommend to OP to reconsider trying to do a system-wide install, and instead build and use JtR in a subdirectory in the user's home directory, like people normally do.
Maybe we need to revise the documentation to make all of the above clearer. The approach we use with non-installation being primary, and system-wide installation being secondary and distros-only, is relatively uncommon.
Maybe we need to revise the approach to make system-wide installation option a first-class citizen, although personally I'm going to continue to recommend non-installation anyway.
Perhaps we need to be friendlier when responding to GitHub issues, even in cases when we feel the john-users mailing list should have been used instead. The person might genuinely think that they're reporting bug(s), and they might be right.
@solardiz commented on GitHub (Oct 20, 2017):
I think we should explicitly state in
INSTALL-UBUNTUthat it's actually about a user-local build, not about a system-wide install, and that the commands not explicitly prefixed bysudomust be run as the user (that will use JtR) rather than as root.I can see how coming from a distro that previously had JtR installed system-wide and reading that file can be confusing. We need to correct that one bug.
@solardiz commented on GitHub (Oct 20, 2017):
Unfortunately, right now doing a proper system-wide install of JtR is complex - we do not support a
make install, and distros' packages effectively implement their own equivalent of it. Perhaps we should add amake installfor simpler use by distros.No wonder that an end-user trying to do a system-wide install would be confused or even astonished. We should more actively discourage that, unless/until it's eventually intended for more than distros.
@solardiz commented on GitHub (Oct 20, 2017):
The
/etc/johnpaths are a Debian package hack. I dislike this, but apparently they "have to" do it per Debian policy. The man page is also a Debian addition. I can see how this can be confusing, but there's little we can do about it, short of perhaps adopting the same directory path as an upstream default for system-wide installs. Right now, our system-wide installs use/usr/share/johnas directory for all data files, including the default config file. Since system-wide installs are only intended for use by distros anyway, I think it's not a big deal that some distros override this and some don't - it's up to them - although I like distros that don't unnecessarily override upstream defaults better.The
john.confvs.john.iniconfusion coming up in error messages is probably something we should fix by simply dropping support for the legacyjohn.inifilenames (needed for filesystems like MS-DOS FAT) along with support for builds with DJGPP. I might do that in the core tree soon. Right now, although JtR checks for both filenames, the.inicomes up in error messages when none of the files are found as it's what's checked for last (is a last resort fallback).@ghost commented on GitHub (Oct 21, 2017):
@ghost commented on GitHub (Oct 21, 2017):
Ok, but the maintainer does not want to deal with this kind of messages in a queue that requires his attention. And he is right:
@ghost commented on GitHub (Oct 21, 2017):
ubuntu docs:
@claudioandre regarding this:
I think many readers will interpret "user-local" to mean "/usr/local", which is quite the opposite of what you're trying to say. I would transpose the words and remove the hyphen. When you say "it's actually about", that's quite soft and indirect. So I would say something like "This is the process to perform a localized install in $HOME. Systemwide installs are experimental, undocumented, and unsupported."
I also think users who are eager to make progress but lazy about reading will skip past the block of English. Speed readers will see that it starts with "Notice" and think it's likely followed by some kind of exception case and skip it. It might have more effect to concisely say:
=== Preconditions
gittool is installedYou must be mistaken. I last ran JtR about 10 years ago, without issue in fact, but I've reinstalled Debian several times since then, and most recently I installed Stretch from scratch. There is no chance of a preexisting
john, and certainly nojohnis found in my$PATH. Since I used-b bleeding-jumboand the two installations I did a day apart are a micro build number apart, I believe I have the bleeding-edge latest. A man page was installed, but as you know I installed initially as root in/usr/local.No, even if I'd known about that readme I would have figured it's not relevant to me since I'm not building a distro, and didn't know of the coupling between that and doing a systemwide install.
debian support:
I didn't realize it was tested on Ubuntu, but this doesn't diminish the proposal -- it just increases the effort to be more than a mere string replacement.
A project has status and recognition when it makes it into an official Debian repository, which should be a long-term goal. Projects that work on proper Debian are deemed trustworthy and capture a wide following largely on the pure Debian platform but also automatically on all Debian derivatives like Ubuntu and Mint. The trustworthiness is conveyed in part by the fact that a Debian developer must sign the work using a key that has been signed by others after showing a state-issued id, and also due to increased transparency (PPAs are not allowed). This integrity-focus makes Debian particularly interesting for projects that produce security tools.
I know I'm getting ahead of myself there, and I don't want to come off as being pushy, but there's clear JtR-promoting benefit for at least going in the direction of Debian support.
historic non-systemwideness:
@solardiz I appreciate the detailed history you've given. I'll forget about a systemwide install for now, it's not that important.
@solardiz commented on GitHub (Oct 21, 2017):
Thank you for the diff, Claudio! It mostly looks good to me. I think interpreting user-local as referring to
/usr/localis a stretch, but we may consider that anyway and revise the wording very slightly - e.g., replacing "user-local" with "local to a user's home directory". I think the rest of your suggested wording can stay as-is.I dislike the specific wording suggested by @libBletchley: no need to refer to $HOME (let's say simply "home directory"); system-wide installs are actually non-experimental and supported - they are just complex and only for use by distros; instead of listing installed
gitas a precondition we may add it to one of the manyapt-getlines; and we already include amkdirto create thesrcdirectory.Sure, but these messages are typically worded as bug reports, not as questions. We should assume good faith - namely, that the person genuinely thinks they're reporting a bug to help the project. To save time, we may have a boilerplate response message that we'll be reusing, but it should be worded not to be as discouraging as our responses to this issue initially were.
@magnumripper commented on GitHub (Oct 21, 2017):
Sorry for being discouraging (indeed I was) and thank you @libBletchley for not giving up.
@solardiz commented on GitHub (Oct 25, 2017):
I've just dropped checks of
john.inifrom the core tree (except when it's built with DJGPP, in which case, on the contrary, onlyjohn.iniis looked for). magnum, please get this into jumbo at your convenience. Thanks!Claudio, I think you're the one to complete and commit the
INSTALL-UBUNTUedits based on the discussion so far. Thanks!@magnumripper commented on GitHub (Oct 26, 2017):
Merged now.
@ghost commented on GitHub (Oct 26, 2017):
I think I forgot to mention that INSTALL-UBUNTU says to run this command:
but if instead I just run
./configurein order to micromanage the process, the output from./configuresays:Configure finished. Now 'make clean && make -s' to compile.So it's unclear if the
j4option is really useful or needed (which I believe is to say run 4 jobs in parallel). If it is, then./configureshould probably be updated to include that if anything to mitigate confusion.@magnumripper commented on GitHub (Oct 26, 2017):
Neither of the options (
-sand-j) are needed at all, but they are useful and/or make things faster. Perhaps I should use-j8in all examples, as Solar recently suggested elsewhere.@ghost commented on GitHub (Nov 1, 2017):
Ok, I'll try to use something like:
Although this issue is worded as a bug report, not as a question, I'm afraid you're mistaken, since it seems to be a request for help.
We assume your are genuinely thinking your are reporting a real bug to help the project. That said, please:
make clean; ./configure; make -sj8;The main point is that we are putting effort in a black hole real users do not read. A good example of it is the answer here: https://github.com/magnumripper/JohnTheRipper/issues/2820#issuecomment-338030682
It simply was not bleeding.
@ghost commented on GitHub (Nov 1, 2017):
Ah, you rich people...
JFR: I had to revert some
-sj4to-sj2inside CI because it was too much. BTW: my own computer might trigger its triskaidekaphobia if I follow this advice.@solardiz commented on GitHub (Nov 1, 2017):
Some edits to the text proposed by Claudio (thanks!)
Let's save this in a text file and reuse it when appropriate?
@frank-dittrich commented on GitHub (Nov 2, 2017):
I would change
to
(adding
-stomake cleanand stop the build if configure detected a problem)or even
@magnumripper commented on GitHub (Nov 3, 2017):
Oh. So maybe we should again change all
-j8to-j4or even-j2?@solardiz commented on GitHub (Nov 3, 2017):
I edited my comment to use Frank's first suggestion. It's not perfect to recommend
make -s distcleanas well because there might not be aMakefileyet at this point, so people would complain that we asked them to run a command that says it can't work.Regarding
-j8, I don't mind reverting to-j4, but probably we shouldn't go lower than that.@ghost commented on GitHub (Nov 3, 2017):
I saved it on wiki at https://github.com/magnumripper/JohnTheRipper/wiki/Interacting-with-the-user-(WIP).
@danielsokolowski commented on GitHub (Mar 11, 2019):
The error
fopen: $JOHN/john.conf: No such file or directoryis misleading. Here I'm trying to fix it by exporting $JOHN environment variable pointing to the/usr/local/src/github-magnumripper-JohnTheRipper/run/built directory and it's not working, but executing john in therunfolder works.The original bug submitter had a point. My suggestion is clarify the error message and you will avoid balding hairlines and future bug submissions.
Ping @claudioandre-br , @magnumripper @kholia
@magnumripper commented on GitHub (Mar 12, 2019):
I can see your point. Please open as a new issue (you can refer to this one from it if you want to)