diff --git a/CHANGELOG.md b/CHANGELOG.md index b194e41..01f4cbe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,19 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [2.0.2] - 2026-07-18 + +### Fixed +- `setPassword` now uses `chpasswd` for reliable non-interactive password updates. +- `validateUsername` now accepts Linux login names up to 32 characters long. +- `addSSHtoUser` no longer appends duplicate keys to `authorized_keys`. +- `removeUser` and `addUserToGroup` now use `spawnWrapper` for consistent error + handling and timeout support. +- Direct `require('linux-sys-user/lib/promise')` now enforces the Linux platform + guard instead of bypassing it. +- Documentation and GitHub Pages navigation updated to reflect the current API, + including `chpasswd` and the `addUser` string shortcut. + ## [2.0.0] - 2026-07-16 ### Added diff --git a/README.md b/README.md index 37c402f..caad5df 100644 --- a/README.md +++ b/README.md @@ -265,6 +265,9 @@ console.log(user); * callback function(err, userInfo) + A string may be passed instead of an object as a shortcut for + `{ username: string, create_home: true }`. + * linuxUser.getExpiration(username, callback) Gets expiration information about a user, returns an Object: @@ -348,7 +351,10 @@ console.log(user); * username String * password String * callback function(err) - + + Uses `chpasswd` to set the password non-interactively. The system must + have `chpasswd` available (usually provided by `shadow-utils`). + * linuxUser.addGroup(groupname, callback) * groupname String * callback function(err, groupInfo) @@ -386,6 +392,9 @@ console.log(user); * key String * callback function(err, true) + The key is appended to the user's `~/.ssh/authorized_keys` only if it is + not already present. + ### License diff --git a/docs/api.html b/docs/api.html index 6187a1b..54b3dae 100644 --- a/docs/api.html +++ b/docs/api.html @@ -154,6 +154,7 @@
args - Object or Stringargs - Object or String. When a string is passed it is treated as { username: string, create_home: true }.username (String) - User name of the user to be createdshell (String|null) - Path to login shell, null uses /usr/sbin/nologincreate_home (Boolean) - Create home directorySets or changes a user's password.
+Sets or changes a user's password using chpasswd.
username (String) - Username to set password forAdds an SSH key to a user's authorized_keys file.
+Adds an SSH key to a user's authorized_keys file. If the key already exists, the call succeeds without creating a duplicate.
user (String) - Username