From f40ba97428047c6007fb148718eebc0ada53264d Mon Sep 17 00:00:00 2001 From: Vitor Henrique Date: Mon, 29 Jan 2024 16:40:59 -0300 Subject: [PATCH 1/4] chpass, chsh: add page for {Free,Net,Open}BSD and update common page --- pages/common/chsh.md | 5 +---- pages/freebsd/chpass.md | 33 +++++++++++++++++++++++++++++++++ pages/linux/chsh.md | 21 +++++++++++++++++++++ pages/netbsd/chpass.md | 29 +++++++++++++++++++++++++++++ pages/openbsd/chpass.md | 21 +++++++++++++++++++++ 5 files changed, 105 insertions(+), 4 deletions(-) create mode 100644 pages/freebsd/chpass.md create mode 100644 pages/linux/chsh.md create mode 100644 pages/netbsd/chpass.md create mode 100644 pages/openbsd/chpass.md diff --git a/pages/common/chsh.md b/pages/common/chsh.md index 36a6bc9a41f67..09b4d329d5be9 100644 --- a/pages/common/chsh.md +++ b/pages/common/chsh.md @@ -1,6 +1,7 @@ # chsh > Change user's login shell. +> See platform-specific pages for more options. > More information: . - Set a specific login shell for the current user interactively: @@ -14,7 +15,3 @@ - Set a login [s]hell for a specific user: `chsh -s {{path/to/shell}} {{username}}` - -- [l]ist available shells: - -`chsh -l` diff --git a/pages/freebsd/chpass.md b/pages/freebsd/chpass.md new file mode 100644 index 0000000000000..37b6898cb8425 --- /dev/null +++ b/pages/freebsd/chpass.md @@ -0,0 +1,33 @@ +# chpass + +> Add or change user database information, including login shell and password. +> See also: `passwd`. +> More information: . + +- Add or change user database information for the current user interactively: + +`su -c chpass` + +- Set a specific login [s]hell for the current user: + +`chpass -s {{path/to/shell}}` + +- Set a login [s]hell for a specific user: + +`chpass -s {{path/to/shell}} {{username}}` + +- Change the account [e]xpire time (in seconds from the epoch, UTC): + +`su -c 'chpass -e {{time}} {{username}}'` + +- Change a user's password: + +`su -c 'chpass -p {{encrypted_password}} {{username}}'` + +- Specify the [h]ostname or address of an NIS server to query: + +`su -c 'chpass -h {{hostname}} {{username}}'` + +- Specify a particular NIS [d]omain (system domain name by default): + +`su -c 'chpass -d {{domain}} {{username}}'` diff --git a/pages/linux/chsh.md b/pages/linux/chsh.md new file mode 100644 index 0000000000000..f8bbdbba33419 --- /dev/null +++ b/pages/linux/chsh.md @@ -0,0 +1,21 @@ +# chsh + +> Change user's login shell. +> Part of `util-linux`. +> More information: . + +- Set a specific login shell for the current user interactively: + +`sudo chsh` + +- Set a specific login [s]hell for the current user: + +`sudo chsh --shell {{path/to/shell}}` + +- Set a login [s]hell for a specific user: + +`sudo chsh --shell {{path/to/shell}} {{username}}` + +- [l]ist available shells: + +`sudo chsh --list-shells` diff --git a/pages/netbsd/chpass.md b/pages/netbsd/chpass.md new file mode 100644 index 0000000000000..f6b13229c7765 --- /dev/null +++ b/pages/netbsd/chpass.md @@ -0,0 +1,29 @@ +# chpass + +> Add or change user database information, including login shell and password. +> See also: `passwd`. +> More information: . + +- Set a specific login shell for the current user interactively: + +`su -c chpass` + +- Set a specific login [s]hell for the current user: + +`chpass -s {{path/to/shell}}` + +- Set a login [s]hell for a specific user: + +`chpass chsh -s {{path/to/shell}} {{username}}` + +- Specify a user database entry in the `passwd` file format: + +`su -c 'chpass -a {{username:encrypted_password:uid:gid:...}} -s {{path/to/file}}' {{username}}` + +- Only update the [l]ocal password file: + +`su -c 'chpass -l -s {{path/to/shell}}' {{username}}` + +- Forcedly change the database [y]P password database entry: + +`su -c 'chpass -y -s {{path/to/shell}}' {{username}}` diff --git a/pages/openbsd/chpass.md b/pages/openbsd/chpass.md new file mode 100644 index 0000000000000..ddd64cb223a95 --- /dev/null +++ b/pages/openbsd/chpass.md @@ -0,0 +1,21 @@ +# chpass + +> Add or change user database information, including login shell and password. +> See also: `passwd`. +> More information: . + +- Set a specific login shell for the current user interactively: + +`doas chsh` + +- Set a specific login [s]hell for the current user: + +`doas chsh -s {{path/to/shell}}` + +- Set a login [s]hell for a specific user: + +`doas chsh -s {{path/to/shell}} {{username}}` + +- Specify a user database entry in the `passwd` file format: + +`doas chsh -a {{username:encrypted_password:uid:gid:...}}` From 707c43a7fbcefcd905e9b19b97fdafc112da2992 Mon Sep 17 00:00:00 2001 From: Vitor Henrique Date: Mon, 29 Jan 2024 16:41:41 -0300 Subject: [PATCH 2/4] pages.*BSD: add aliases for chpass --- pages/freebsd/chfn.md | 7 +++++++ pages/freebsd/chsh.md | 7 +++++++ pages/freebsd/ypchfn.md | 7 +++++++ pages/freebsd/ypchpass.md | 7 +++++++ pages/freebsd/ypchsh.md | 7 +++++++ pages/netbsd/chfn.md | 7 +++++++ pages/netbsd/chsh.md | 7 +++++++ pages/openbsd/chfn.md | 7 +++++++ pages/openbsd/chsh.md | 7 +++++++ scripts/set-alias-page.py | 2 +- 10 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 pages/freebsd/chfn.md create mode 100644 pages/freebsd/chsh.md create mode 100644 pages/freebsd/ypchfn.md create mode 100644 pages/freebsd/ypchpass.md create mode 100644 pages/freebsd/ypchsh.md create mode 100644 pages/netbsd/chfn.md create mode 100644 pages/netbsd/chsh.md create mode 100644 pages/openbsd/chfn.md create mode 100644 pages/openbsd/chsh.md diff --git a/pages/freebsd/chfn.md b/pages/freebsd/chfn.md new file mode 100644 index 0000000000000..ea8525ffe24dc --- /dev/null +++ b/pages/freebsd/chfn.md @@ -0,0 +1,7 @@ +# chfn + +> This command is an alias of `chpass`. + +- View documentation for the original command: + +`tldr chpass` diff --git a/pages/freebsd/chsh.md b/pages/freebsd/chsh.md new file mode 100644 index 0000000000000..c9e2673cd8e99 --- /dev/null +++ b/pages/freebsd/chsh.md @@ -0,0 +1,7 @@ +# chsh + +> This command is an alias of `chpass`. + +- View documentation for the original command: + +`tldr chpass` diff --git a/pages/freebsd/ypchfn.md b/pages/freebsd/ypchfn.md new file mode 100644 index 0000000000000..447909c98addd --- /dev/null +++ b/pages/freebsd/ypchfn.md @@ -0,0 +1,7 @@ +# ypchfn + +> This command is an alias of `chpass`. + +- View documentation for the original command: + +`tldr chpass` diff --git a/pages/freebsd/ypchpass.md b/pages/freebsd/ypchpass.md new file mode 100644 index 0000000000000..61dc1fdbd16a0 --- /dev/null +++ b/pages/freebsd/ypchpass.md @@ -0,0 +1,7 @@ +# ypchpass + +> This command is an alias of `chpass`. + +- View documentation for the original command: + +`tldr chpass` diff --git a/pages/freebsd/ypchsh.md b/pages/freebsd/ypchsh.md new file mode 100644 index 0000000000000..6bc1572ba3707 --- /dev/null +++ b/pages/freebsd/ypchsh.md @@ -0,0 +1,7 @@ +# ypchsh + +> This command is an alias of `chpass`. + +- View documentation for the original command: + +`tldr chpass` diff --git a/pages/netbsd/chfn.md b/pages/netbsd/chfn.md new file mode 100644 index 0000000000000..ea8525ffe24dc --- /dev/null +++ b/pages/netbsd/chfn.md @@ -0,0 +1,7 @@ +# chfn + +> This command is an alias of `chpass`. + +- View documentation for the original command: + +`tldr chpass` diff --git a/pages/netbsd/chsh.md b/pages/netbsd/chsh.md new file mode 100644 index 0000000000000..c9e2673cd8e99 --- /dev/null +++ b/pages/netbsd/chsh.md @@ -0,0 +1,7 @@ +# chsh + +> This command is an alias of `chpass`. + +- View documentation for the original command: + +`tldr chpass` diff --git a/pages/openbsd/chfn.md b/pages/openbsd/chfn.md new file mode 100644 index 0000000000000..ea8525ffe24dc --- /dev/null +++ b/pages/openbsd/chfn.md @@ -0,0 +1,7 @@ +# chfn + +> This command is an alias of `chpass`. + +- View documentation for the original command: + +`tldr chpass` diff --git a/pages/openbsd/chsh.md b/pages/openbsd/chsh.md new file mode 100644 index 0000000000000..c9e2673cd8e99 --- /dev/null +++ b/pages/openbsd/chsh.md @@ -0,0 +1,7 @@ +# chsh + +> This command is an alias of `chpass`. + +- View documentation for the original command: + +`tldr chpass` diff --git a/scripts/set-alias-page.py b/scripts/set-alias-page.py index 697792242e6ed..37a83c45a7ad6 100755 --- a/scripts/set-alias-page.py +++ b/scripts/set-alias-page.py @@ -51,7 +51,7 @@ def get_tldr_root(): """ # If this script is running from tldr/scripts, the parent's parent is the root - f = os.path.normpath(__file__) + f = os.path.normpath(__file__).replace('\\', '/') if f.endswith("tldr/scripts/set-alias-page.py"): return os.path.dirname(os.path.dirname(f)) From 053d90ca827bca8057c7c9de93f1f70d0f20ab5c Mon Sep 17 00:00:00 2001 From: Vitor Henrique Date: Mon, 29 Jan 2024 16:51:30 -0300 Subject: [PATCH 3/4] chpass: add page for osx --- pages/osx/chpass.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 pages/osx/chpass.md diff --git a/pages/osx/chpass.md b/pages/osx/chpass.md new file mode 100644 index 0000000000000..691a3061c3433 --- /dev/null +++ b/pages/osx/chpass.md @@ -0,0 +1,26 @@ +# chpass + +> Add or change user database information, including login shell and password. +> NOTE: it's not possible to change the user's password on Open Directory systems, use `passwd` instead. +> See also: `passwd`. +> More information: . + +- Add or change user database information for the current user interactively: + +`su -c chpass` + +- Set a specific login [s]hell for the current user: + +`chpass -s {{path/to/shell}}` + +- Set a login [s]hell for a specific user: + +`chpass -s {{path/to/shell}} {{username}}` + +- Edit the user record on the directory node at the given [l]ocation: + +`chpass -l {{location}} -s {{path/to/shell}} {{username}}` + +- Use the given [u]sername when authenticating to the directory node containing the user: + +`chpass -u {{authname}} -s {{path/to/shell}} {{username}}` From 30372dd4d9fe73715ae65f841114f3231484f6e6 Mon Sep 17 00:00:00 2001 From: Vitor Henrique <87824454+vitorhcl@users.noreply.github.com> Date: Mon, 29 Jan 2024 23:13:21 -0300 Subject: [PATCH 4/4] scripts/set-alias-page.py: revert change --- scripts/set-alias-page.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/set-alias-page.py b/scripts/set-alias-page.py index 37a83c45a7ad6..697792242e6ed 100755 --- a/scripts/set-alias-page.py +++ b/scripts/set-alias-page.py @@ -51,7 +51,7 @@ def get_tldr_root(): """ # If this script is running from tldr/scripts, the parent's parent is the root - f = os.path.normpath(__file__).replace('\\', '/') + f = os.path.normpath(__file__) if f.endswith("tldr/scripts/set-alias-page.py"): return os.path.dirname(os.path.dirname(f))