GitShow/sindresorhus/default-uid
sindresorhus

default-uid

Get the system default UID

by sindresorhus
Star on GitHubForknpm

JavaScript

13 stars6 forks2 contributorsQuiet · 2y agoSince 2015v2.0.0MIT

Meet the team

See all 2 on GitHub →
sindresorhus
sindresorhus10 contributions
Richienb
Richienb1 contribution

Languages

View on GitHub →
JavaScript100%

Commit activity

Last 12 weeks · 0 commits

Full graph →

Community health

4 of 6 standards met

Community profile →
85
✓README✓License✓Contributing✓Code of Conduct○Issue Template○PR Template

Recent fixes

View closed PRs →
silverwind
Linux detectionMergedPR

This adds detection for RedHat-based distros as well as returning the lowest _active_ UID after UID_MIN, as discussed in #1. I gave it some basic testing on CentOS and I'm confident it'll work fine on other distros, even when the two files don't exist (in which case we fall back to the hardcoded UIDs). I didn't see the need to support 4 year old Fedora, so that's not included. Leaving this up for discussion, as it's pretty much a rewrite and also changes the behaviour to async (required by ).

silverwind · 5y ago
Richienb
Move to GitHub ActionsMergedPR
Richienb · 5y ago
silverwind
Find first uid on various linux distributionsClosedIssue

From wikipedia: Some POSIX systems allocate UIDs for new users starting from 500 (OS X, Red Hat Enterprise Linux), others start at 1000 (openSUSE, Debian[5]). On many Linux systems, these ranges are specified in /etc/login.defs, for useradd and similar tools. I think an approach would be: 1) read , return UID_MIN if found. Here's the relevant section from Arch Linux: 2) if there's no uid from step 1, try to detect distribution, maybe through or similar, and fall back to a hardcoded list of uids for distributions.

silverwind · 11y ago
Structured data for AI agents

Repository: sindresorhus/default-uid. Description: Get the system default UID Stars: 13, Forks: 6. Primary language: JavaScript. Languages: JavaScript (100%). License: MIT. Latest release: v2.0.0 (5y ago). Open PRs: 0, open issues: 0. Last activity: 2y ago. Community health: 85%. Top contributors: sindresorhus, Richienb.

·@ofershap

Replace github.com with gitshow.dev