A PAM module that runs multiple other PAM modules in parallel, succeeding as long as one of them succeeds.

Related tags

Command-line pam-any
Overview

PAM Any

A PAM module that runs multiple other PAM modules in parallel, succeeding as long as one of them succeeds.

Development

I created a VM to test stuff without messing up the distro I code in.

  • Create a Fedora VM (can probably be any distro)
  • Create a user named test
  • Enable SSH server
  • Enable root password
  • Enable root SSH
  • Setup password-less SSH login
  • Setup pam-random as a 2nd test module
  • Update the IP variable in test.sh
  • Run bash ./test.sh
  • Inside the VM install pamtester
  • Inside the VM run pamtester pam-any test authenticate
You might also like...
Ideas = Creations, a multi-language CMS(Content Management System) based on Rust Web stacks, with long-term upgrade and maintenance.

Ideas = Creations 中文 RustHub: Rust ideas yesterday, shining creations today! This repository holds source code used to run https://rusthub.org, it's

Fast tool to scan for valid 7-long imgur ids for the ArchiveTeam imgur efforts (not affiliated or endorsed)

imgur_id7 Fast tool to scan for valid 7-long imgur ids for the ArchiveTeam imgur efforts (not affiliated or endorsed) Optionally uses supplied http pr

Tumour-only somatic mutation calling using long reads

smrest smrest is a prototype somatic mutation caller for single molecule long reads. It uses haplotype phasing patterns for tumour samples that have a

1 library and 2 binary crates to run SSH/SCP commands on a
1 library and 2 binary crates to run SSH/SCP commands on a "mass" of hosts in parallel

massh 1 library and 2 binary crates to run SSH/SCP commands on a "mass" of hosts in parallel. The binary crates are CLI and GUI "frontends" for the li

Parallel iteration of FASTA/FASTQ files, for when sequence order doesn't matter but speed does

Rust-parallelfastx A truly parallel parser for FASTA/FASTQ files. Principle The input file is memory-mapped then virtually split into N chunks. Each c

Cloud-optimized GeoTIFF ... Parallel I/O 🦀

cog3pio Cloud-optimized GeoTIFF ... Parallel I/O Yet another attempt at creating a GeoTIFF reader, in Rust, with Python bindings. Installation Rust ca

zsh modules written in rust

zsh-module-poc Can you make a module for zsh written in Rust? Yes, yes you can and this is a proof of concept. It's a start but I have no idea how to

Create, reorder, group, and focus workspaces easily in i3. Fully configurable with enhanced polybar modules.
Create, reorder, group, and focus workspaces easily in i3. Fully configurable with enhanced polybar modules.

Create, reorder, group, and focus workspaces fast and easily in i3. Features Focus Mode: Eliminate Distractions Enable Focus Mode: Use groups and focu

Simple system monitoring app that runs on terminal. Made purely with Rust.
Simple system monitoring app that runs on terminal. Made purely with Rust.

What is it? RCTOP is a simple WIP system monitoring app that runs purely on terminal and doesn't feature GUI. One can compare it to htop, but more str

Comments
  • Don't block non-promt conversations services while another service is promting

    Don't block non-promt conversations services while another service is promting

    Test setup

    In order to authenticate to su suing password OR fingerprint I used the following setup. Relevant contents of /etc/pam.d/su:

    [...]
    auth            required        pam_any.so {"any-fingerprint": "Fingerprint", "any-password": "Password"}
    [...]
    

    Content of /etc/pam.d/any-fingerprint:

    auth            required        pam_fprintd.so
    account         required        pam_permit.so
    

    Content of /etc/pam.d/any-password:

    auth            required        pam_unix.so
    account         required        pam_permit.so
    

    Problem description

    When trying to authenticate using a fingerprint, the authentication does not succeed until a (invalid/empty) password is provided as shown here:

    $ pamtester su skruppy authenticate
    [Password] Password: 
    [Fingerprint] Place your right index finger on the fingerprint reader
    pamtester: successfully authenticated
    

    Cause of the issue

    This is caused by pam_unix always being faster asking for a password than pam_fprintd wanting to print some informational notices. Due to the mutex placed on the upstream conversation, the progress of pam_fprintd is halted at the output request of the info message until an user input has been provided to pam_unix. Hence the pam_fprintd module never returns any result before pam_unix.

    Possible solutions

    Reply non-promt requests from queue

    For non promt_* calls like info() or error() add them to a queue during an ongoing promt-call and reply them once the promt is done.

    Combine non-promt requests

    For non promt_* calls like info() or error() collect the messages in a single concatenated message during an ongoing promt-call. Send this concatenated message once the promt-call has finished.

    This has the advantage that GUIs which might only show a single message at a time do not only show the last queued message, but all of them.

    bug help wanted 
    opened by skruppy 2
  • Add option for either OR/AND

    Add option for either OR/AND

    Thank you for developing this module.

    I think the possibility to decide whether all or just one the modules called by pam_any have to succeed would be pretty nice.

    Example 1: I use both howdy and a bluetooth module and only want PAM to accept me if my face gets recognized AND my smartphone is reachable via BT.

    Example 2: If I used howdy and a fingerpint reader, I would probably want to only do one of both at a time, so I would need an OR check. (This is already implemented)

    opened by c4tz 0
  • Investigate and document thread safety requirements

    Investigate and document thread safety requirements

    According to pam(3)

    The libpam interfaces are only thread-safe if each thread within the multithreaded application uses its own PAM handle.

    Looks to me like the current implementation either is unsound due to violating libpam thread-safety requirements or relies on some internal libpam implementation details for soundness.

    help wanted 
    opened by tanriol 2
Owner
Rajas Paranjpe
Rajas Paranjpe
An experimental, work-in-progress PAM module for Tailscale

Experimental Tailscale PAM Module This is a very very experimental Tailscale PAM module that allows you to SSH using your Tailscale credentials. This

Tailscale 129 Nov 20, 2022
This PAM module provides ssh-agent based authentication

PAM-RSSH This PAM module provides ssh-agent based authentication. The primary design goal is to avoid typing password when you sudo on remote servers.

Yuxiang Zhang 21 Dec 14, 2022
CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a plotable format.

Lighthouse Aggregator CLI tool that make it easier to perform multiple lighthouse runs towards a single target and output the result in a "plotable" f

Polestar 1 Jan 12, 2022
Captures packets and streams them to other devices. Built for home network analysis and A&D CTFs.

?? shiny-donut shiny-donut is a packet capture app that supports streaming packets from a remote system to another device. The main use for this is to

Justin Perez 3 Nov 30, 2022
🌌⭐cosmo is a wrapper for Git essentially, allowing you to compress multiple commands into one

❯ Cosmo Git tooling of the future New feature: Cosmo hooks! Click here for more info! ❯ ?? Features Config files (with defaults!) Fast Easy to use Fri

Jack 1 Oct 31, 2021
A little tool to create region-free openingTitle.arc files for New Super Mario Bros. Wii, or to convert them from one region to another

smallworld ...though the mountains divide and the oceans are wide... smallworld is a little tool that can create region-free openingTitle.arc files fo

NSMBW Community 7 Feb 6, 2023
A super simple /sbin/init for Linux which allows running one and only one program

Summary High-performance /sbin/init program for Linux This is designed to do literally nothing but accept binaries over the network and run them as a

null 19 Dec 4, 2023
argmax is a library that allows Rust applications to avoid Argument list too long errors (E2BIG) by providing a std::process::Command wrapper with a

argmax argmax is a library that allows Rust applications to avoid Argument list too long errors (E2BIG) by providing a std::process::Command wrapper w

David Peter 22 Nov 20, 2022
🧠 A command-line utility for switching git branches more easily. Switch branches interactively or use a fuzzy search to find that long-forgotten branch name.

git-smart-checkout A git command extension for switching git branches more efficiently. About Interactively switch branches or fuzzy search for that f

Cezar Craciun 51 Dec 29, 2022
Is the GIL seeing someone else? How's about repetitively calling and seeing how long it takes to answer?

GIL Knocker pip install gilknocker When you thought the GIL was available, and you find yourself suspecting it might be spending time with another. Yo

Miles Granger 4 Jan 18, 2023