From owner-freebsd-questions@freebsd.org Sun Aug 16 13:09:04 2020 Return-Path: Delivered-To: freebsd-questions@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B0EA13BB5EA for ; Sun, 16 Aug 2020 13:09:04 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from bede.qeng-ho.org (bede.qeng-ho.org [217.155.128.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4BTyDb2y0Gz4Lg0 for ; Sun, 16 Aug 2020 13:09:03 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from arthur.home.qeng-ho.org (arthur.home.qeng-ho.org [172.23.1.2]) by bede.qeng-ho.org (Postfix) with ESMTP id 01B301063C; Sun, 16 Aug 2020 14:09:01 +0100 (BST) Subject: Re: Verify user password To: Grzegorz Junka , freebsd-questions@freebsd.org References: <0567033d-fa75-06b2-5629-448fdc507242@qeng-ho.org> <091dca7e-28ab-eab0-7265-d0439a732d86@gjunka.com> From: Arthur Chance Message-ID: Date: Sun, 16 Aug 2020 14:09:01 +0100 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: <091dca7e-28ab-eab0-7265-d0439a732d86@gjunka.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-GB Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1597583344; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xe+RHhxyUFfaSxt8k0IhnAyhI1hQeBEvhq2xnyFb1p8=; b=fZqHBlmNuDmaIQa3Yp13sgPNidXTy3FqXA96DWeyxwRRtjEAeJgYyIAd54TWirS4ZfPp8A xa+HoOp4abgT8eK4nE5lz0GuKPHjHTUYIPlLW6ublh0pZX+KoO1GhFvukzAToSKY5+3a7S D+NmhGRKnPDgrS7Al6R/6wE9/9LTZq/67Jxno1cSxV4f/xFYJW8kFr7e3wTXLJIKZSJ3Ye yZHcKW8suw7BsvIm8KgYzYNl7tWQ7NoJV9R5jWxz9qX9HQdJyQPhAuucPN/UmzsQr4UkNL R5WfLvlOBzK6qiTmReTlvaPbAM5a2AOfqJngF9ffdtTJNkMQUi7mpOEPJi6yDw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1597583344; a=rsa-sha256; cv=none; b=aPezm/fr11Mb475+Xue/1rLs2wbwKzQftEx7kqjoh5dijmm6QQus7NEz7o4I/O/oMawJmP /gjNs59WuhJ4MNFn7doriQq9BWnKEr+50Y8frjifQPZwDukCpB0i1XYoeEHIXb1ZTgkaLi d5i/09vyotSRjngQ57epBDPFzORoLs1stY134R3JAWOPRLD+rpH5TjP9SFRjIDgUT4L2sq hYmENm2Z7uzZYTCdolLpRrCNCnqbflFBkv/o9e/MciXDalslciAQtJjt8xaLaVqNIxzk/H qYOT2HjA1t8S2ciM4p+OUyJ254ImnvCPWITEFIq53YBqcie39LOg6msn9Rk9Eg== ARC-Authentication-Results: i=1; mx1.freebsd.org; dkim=none; spf=pass (mx1.freebsd.org: domain of freebsd@qeng-ho.org designates 217.155.128.241 as permitted sender) smtp.mailfrom=freebsd@qeng-ho.org X-Rspamd-Queue-Id: 4BTyDb2y0Gz4Lg0 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@qeng-ho.org designates 217.155.128.241 as permitted sender) smtp.mailfrom=freebsd@qeng-ho.org X-Spamd-Result: default: False [-3.39 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.05)[-1.046]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:217.155.128.240/29]; NEURAL_HAM_LONG(-0.99)[-0.991]; MIME_GOOD(-0.10)[text/plain]; ARC_SIGNED(0.00)[i=1]; DMARC_NA(0.00)[qeng-ho.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_HAM_SHORT(-1.06)[-1.057]; RCPT_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:13037, ipnet:217.155.0.0/16, country:GB]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Aug 2020 13:09:04 -0000 On 16/08/2020 12:03, Grzegorz Junka wrote: > > On 15/08/2020 13:31, Arthur Chance wrote: >> On 15/08/2020 13:39, Grzegorz Junka wrote: >>> How can I verify if a given password matches the password stored in >>> master.passwd database for a user account that is set up with >>> /nonexistent and /usr/sbin/nologin (so a user that can't normally login >>> to the system but still can have a password stored in the database)? >> nologin doesn't stop you logging in, it merely says the account isn't >> available and boots you out afterwards, so you should be able to check >> the password by trying to log in. I don't think the non-existent home >> directory affects that, > > > OK, how can I login with that user then? "su" that user returns "This > account is currently not available". "login" that user says "Not a login > shell.". The user is configured inside a jail and there is no sshd running. Try using /usr/bin/login, not just "login" which is a shell builtin. -- The number of people predicting the demise of Moore's Law doubles every 18 months.