logo

skeud

Simple and portable utilities to deal with user accounts (su, login)

su.1 (1621B)


  1. .\" SPDX-FileCopyrightText: 2023 Haelwenn (lanodan) Monnier <contact+skeud@hacktivis.me>
  2. .\" SPDX-License-Identifier: MPL-2.0
  3. .Dd 2023-09-10
  4. .Dt SU 1
  5. .Os
  6. .Sh NAME
  7. .Nm su
  8. .Nd switch user
  9. .Sh SYNOPSIS
  10. .Nm
  11. .Op Fl pl
  12. .Op Fl c Ar command
  13. .Op Fl s Ar shell
  14. .Op Fl
  15. .Op Ar username
  16. .Sh DESCRIPTION
  17. The
  18. .Nm
  19. utility allows to switch to another user.
  20. .Pp
  21. Regardless of any options, the following environment variables are always reset:
  22. .Ev HOME ,
  23. .Ev USER ,
  24. .Ev LOGNAME ,
  25. .Ev SHELL ,
  26. .Ev IFS .
  27. Note that while some other implementations will setup some values for
  28. .Ev PATH
  29. this utility considers it to be something for the shell to set.
  30. .Ss OPTIONS
  31. .Bl -tag -width Ds
  32. .It Fl p
  33. (Super-User only) Preserve environment, otherwise only
  34. .Ev TERM
  35. is kept.
  36. .It Fl l , Fl
  37. Provide a clean environment similar to what you would get with
  38. .Xr login 1 .
  39. Done via setting the current working directory to the target user home folder and passing the
  40. .Fl l
  41. flag to the shell.
  42. .Pp
  43. Note that the
  44. .Fl
  45. alias is only accepted as the last option flag.
  46. .It Fl c Ar command
  47. Command to run instead of interactive shell.
  48. .It Fl s Ar shell
  49. (Super-User only) Shell to use instead of shell entry in
  50. .Xr passwd 5 .
  51. .El
  52. .Sh EXIT STATUS
  53. If the user's shell is invoked, the exit status of
  54. .Nm
  55. shall be the exit status of the shell.
  56. Otherwise, the
  57. .Nm
  58. utility shall exit with one of the following values:
  59. .Bl -tag -width Ds
  60. .It 1
  61. An error occured or the authentication failed
  62. .It 126
  63. User's shell was found but couldn't be invoked.
  64. .It 127
  65. User's shell wasn't found.
  66. .El
  67. .Sh STANDARDS
  68. N/A
  69. .Sh AUTHORS
  70. .An Haelwenn (lanodan) Monnier Aq Mt contact+skeud@hacktivis.me