Facebook
From lukaz1987, 11 Months ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 103
  1. debian 10 (buster) don`t work init, halt, reboot
  2. /etc/profiles
  3. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=918754
  4. https://unix.stackexchange.com/questions/460478/debian-su-and-su-path-differences
  5. https://www.linuxquestions.org/questions/debian-26/problem-after-upgrading-to-buster-from-stretch-4175658508/page2.html
  6.  
  7. echo "$PATH"
  8.  
  9.  
  10. # /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
  11. # and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).
  12.  
  13. if [ "`id -u`" -eq 0 ]; then
  14.     PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
  15. else
  16.   PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games"
  17. fi
  18. export PATH
  19.  
  20. if [ "${PS1-}" ]; then
  21.   if [ "${BASH-}" ] && [ "$BASH" != "/bin/sh" ]; then
  22.     # The file bash.bashrc already sets the default PS1.
  23.     # PS1='\h:\w\$ '
  24.     if [ -f /etc/bash.bashrc ]; then
  25.       . /etc/bash.bashrc
  26.     fi
  27.   else
  28.     if [ "`id -u`" -eq 0 ]; then
  29.       PS1='# '
  30.     else
  31.       PS1='$ '
  32.     fi
  33.   fi
  34. fi
  35.  
  36. if [ -d /etc/profile.d ]; then
  37.   for i in /etc/profile.d/*.sh; do
  38.     if [ -r $i ]; then
  39.       . $i
  40.     fi
  41.   done
  42.   unset i
  43. fi
  44.  
  45.  
  46.  
  47.  
  48.  
  49. #
  50. # /etc/login.defs - Configuration control definitions for the login package.
  51. #
  52. # Three items must be defined:  MAIL_DIR, ENV_SUPATH, and ENV_PATH.
  53. # If unspecified, some arbitrary (and possibly incorrect) value will
  54. # be assumed.  All other items are optional - if not specified then
  55. # the described action or option will be inhibited.
  56. #
  57. # Comment lines (lines beginning with "#") and blank lines are ignored.
  58. #
  59. # Modified for Linux.  --marekm
  60.  
  61. # REQUIRED for useradd/userdel/usermod
  62. #   Directory where mailboxes reside, _or_ name of file, relative to the
  63. #   home directory.  If you _do_ define MAIL_DIR and MAIL_FILE,
  64. #   MAIL_DIR takes precedence.
  65. #
  66. #   Essentially:
  67. #      - MAIL_DIR defines the location of users mail spool files
  68. #        (for mbox use) by appending the username to MAIL_DIR as defined
  69. #        below.
  70. #      - MAIL_FILE defines the location of the users mail spool files as the
  71. #        fully-qualified filename obtained by prepending the user home
  72. #        directory before $MAIL_FILE
  73. #
  74. # NOTE: This is no more used for setting up users MAIL environment variable
  75. #       which is, starting from shadow 4.0.12-1 in Debian, entirely the
  76. #       job of the pam_mail PAM modules
  77. #       See default PAM configuration files provided for
  78. #       login, su, etc.
  79. #
  80. # This is a temporary situation: setting these variables will soon
  81. # move to /etc/default/useradd and the variables will then be
  82. # no more supported
  83. MAIL_DIR        /var/mail
  84. #MAIL_FILE      .mail
  85.  
  86. #
  87. # Enable logging and display of /var/log/faillog login failure info.
  88. # This option conflicts with the pam_tally PAM module.
  89. #
  90. FAILLOG_ENAB            yes
  91.  
  92. #
  93. # Enable display of unknown usernames when login failures are recorded.
  94. #
  95. # WARNING: Unknown usernames may become world readable.
  96. # See #290803 and #298773 for details about how this could become a security
  97. # concern
  98. LOG_UNKFAIL_ENAB        no
  99.  
  100. #
  101. # Enable logging of successful logins
  102. #
  103. LOG_OK_LOGINS           no
  104.  
  105. #
  106. # Enable "syslog" logging of su activity - in addition to sulog file logging.
  107. # SYSLOG_SG_ENAB does the same for newgrp and sg.
  108. #
  109. SYSLOG_SU_ENAB          yes
  110. SYSLOG_SG_ENAB          yes
  111.  
  112. #
  113. # If defined, all su activity is logged to this file.
  114. #
  115. #SULOG_FILE     /var/log/sulog
  116.  
  117. #
  118. # If defined, file which maps tty line to TERM environment parameter.
  119. # Each line of the file is in a format something like "vt100  tty01".
  120. #
  121. #TTYTYPE_FILE   /etc/ttytype
  122.  
  123. #
  124. # If defined, login failures will be logged here in a utmp format
  125. # last, when invoked as lastb, will read /var/log/btmp, so...
  126. #
  127. FTMP_FILE       /var/log/btmp
  128.  
  129. #
  130. # If defined, the command name to display when running "su -".  For
  131. # example, if this is defined as "su" then a "ps" will display the
  132. # command is "-su".  If not defined, then "ps" would display the
  133. # name of the shell actually being run, e.g. something like "-sh".
  134. #
  135. SU_NAME         su
  136.  
  137. #
  138. # If defined, file which inhibits all the usual chatter during the login
  139. # sequence.  If a full pathname, then hushed mode will be enabled if the
  140. # user's name or shell are found in the file.  If not a full pathname, then
  141. # hushed mode will be enabled if the file exists in the user's home directory.
  142. #
  143. HUSHLOGIN_FILE  .hushlogin
  144. #HUSHLOGIN_FILE /etc/hushlogins
  145.  
  146. #
  147. # *REQUIRED*  The default PATH settings, for superuser and normal users.
  148. #
  149. # (they are minimal, add the rest in the shell startup files)
  150. #ENV_SUPATH     PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  151. #ENV_PATH       PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
  152.  
  153. ENV_SUPATH      PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
  154. ENV_PATH        PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
  155.  
  156. #
  157. # Terminal permissions
  158. #
  159. #       TTYGROUP        Login tty will be assigned this group ownership.
  160. #       TTYPERM         Login tty will be set to this permission.
  161. #
  162. # If you have a "write" program which is "setgid" to a special group
  163. # which owns the terminals, define TTYGROUP to the group number and
  164. # TTYPERM to 0620.  Otherwise leave TTYGROUP commented out and assign
  165. # TTYPERM to either 622 or 600.
  166. #
  167. # In Debian /usr/bin/bsd-write or similar programs are setgid tty
  168. # However, the default and recommended value for TTYPERM is still 0600
  169. # to not allow anyone to write to anyone else console or terminal
  170.  
  171. # Users can still allow other people to write them by issuing
  172. # the "mesg y" command.
  173.  
  174. TTYGROUP        tty
  175. TTYPERM         0600
  176.  
  177. #
  178. # Login configuration initializations:
  179. #
  180. #       ERASECHAR       Terminal ERASE character ('\010' = backspace).
  181. #       KILLCHAR        Terminal KILL character ('\025' = CTRL/U).
  182. #       UMASK           Default "umask" value.
  183. #
  184. # The ERASECHAR and KILLCHAR are used only on System V machines.
  185. #
  186. # UMASK is the default umask value for pam_umask and is used by
  187. # useradd and newusers to set the mode of the new home directories.
  188. # 022 is the "historical" value in Debian for UMASK
  189. # 027, or even 077, could be considered better for privacy
  190. # There is no One True Answer here : each sysadmin must make up his/her
  191. # mind.
  192. #
  193. # If USERGROUPS_ENAB is set to "yes", that will modify this UMASK default value
  194. # for private user groups, i. e. the uid is the same as gid, and username is
  195. # the same as the primary group name: for these, the user permissions will be
  196. # used as group permissions, e. g. 022 will become 002.
  197. #
  198. # Prefix these values with "0" to get octal, "0x" to get hexadecimal.
  199. #
  200. ERASECHAR       0177
  201. KILLCHAR        025
  202. UMASK           022
  203.  
  204. #
  205. # Password aging controls:
  206. #
  207. #       PASS_MAX_DAYS   Maximum number of days a password may be used.
  208. #       PASS_MIN_DAYS   Minimum number of days allowed between password changes.
  209. #       PASS_WARN_AGE   Number of days warning given before a password expires.
  210. #
  211. PASS_MAX_DAYS   99999
  212. PASS_MIN_DAYS   0
  213. PASS_WARN_AGE   7
  214.  
  215. #
  216. # Min/max values for automatic uid selection in useradd
  217. #
  218. UID_MIN                  1000
  219. UID_MAX                 60000
  220. # System accounts
  221. #SYS_UID_MIN              100
  222. #SYS_UID_MAX              999
  223.  
  224. #
  225. # Min/max values for automatic gid selection in groupadd
  226. #
  227. GID_MIN                  1000
  228. GID_MAX                 60000
  229. # System accounts
  230. #SYS_GID_MIN              100
  231. #SYS_GID_MAX              999
  232.  
  233. #
  234. # Max number of login retries if password is bad. This will most likely be
  235. # overriden by PAM, since the default pam_unix module has it's own built
  236. # in of 3 retries. However, this is a safe fallback in case you are using
  237. # an authentication module that does not enforce PAM_MAXTRIES.
  238. #
  239. LOGIN_RETRIES           5
  240.  
  241. #
  242. # Max time in seconds for login
  243. #
  244. LOGIN_TIMEOUT           60
  245.  
  246. #
  247. # Which fields may be changed by regular users using chfn - use
  248. # any combination of letters "frwh" (full name, room number, work
  249. # phone, home phone).  If not defined, no changes are allowed.
  250. # For backward compatibility, "yes" = "rwh" and "no" = "frwh".
  251. #
  252. CHFN_RESTRICT           rwh
  253.  
  254. #
  255. # Should login be allowed if we can't cd to the home directory?
  256. # Default in no.
  257. #
  258. DEFAULT_HOME    yes
  259.  
  260. #
  261. # If defined, this command is run when removing a user.
  262. # It should remove any at/cron/print jobs etc. owned by
  263. # the user to be removed (passed as the first argument).
  264. #
  265. #USERDEL_CMD    /usr/sbin/userdel_local
  266.  
  267. #
  268. # If set to yes, userdel will remove the user's group if it contains no
  269. # more members, and useradd will create by default a group with the name
  270. # of the user.
  271. #
  272. # Other former uses of this variable such as setting the umask when
  273. # user==primary group are not used in PAM environments, such as Debian
  274. #
  275. USERGROUPS_ENAB yes
  276.  
  277. #
  278. # Instead of the real user shell, the program specified by this parameter
  279. # will be launched, although its visible name (argv[0]) will be the shell's.
  280. # The program may do whatever it wants (logging, additional authentification,
  281. # banner, ...) before running the actual shell.
  282. #
  283. # FAKE_SHELL /bin/fakeshell
  284.  
  285. #
  286. # If defined, either full pathname of a file containing device names or
  287. # a ":" delimited list of device names.  Root logins will be allowed only
  288. # upon these devices.
  289. #
  290. # This variable is used by login and su.
  291. #
  292. #CONSOLE        /etc/consoles
  293. #CONSOLE        console:tty01:tty02:tty03:tty04
  294.  
  295. #
  296. # List of groups to add to the user's supplementary group set
  297. # when logging in on the console (as determined by the CONSOLE
  298. # setting).  Default is none.
  299. #
  300. # Use with caution - it is possible for users to gain permanent
  301. # access to these groups, even when not logged in on the console.
  302. # How to do it is left as an exercise for the reader...
  303. #
  304. # This variable is used by login and su.
  305. #
  306. #CONSOLE_GROUPS         floppy:audio:cdrom
  307.  
  308. #
  309. # If set to "yes", new passwords will be encrypted using the MD5-based
  310. # algorithm compatible with the one used by recent releases of FreeBSD.
  311. # It supports passwords of unlimited length and longer salt strings.
  312. # Set to "no" if you need to copy encrypted passwords to other systems
  313. # which don't understand the new algorithm.  Default is "no".
  314. #
  315. # This variable is deprecated. You should use ENCRYPT_METHOD.
  316. #
  317. #MD5_CRYPT_ENAB no
  318.  
  319. #
  320. # If set to MD5 , MD5-based algorithm will be used for encrypting password
  321. # If set to SHA256, SHA256-based algorithm will be used for encrypting password
  322. # If set to SHA512, SHA512-based algorithm will be used for encrypting password
  323. # If set to DES, DES-based algorithm will be used for encrypting password (default)
  324. # Overrides the MD5_CRYPT_ENAB option
  325. #
  326. # Note: It is recommended to use a value consistent with
  327. # the PAM modules configuration.
  328. #
  329. ENCRYPT_METHOD SHA512
  330.  
  331. #
  332. # Only used if ENCRYPT_METHOD is set to SHA256 or SHA512.
  333. #
  334. # Define the number of SHA rounds.
  335. # With a lot of rounds, it is more difficult to brute forcing the password.
  336. # But note also that it more CPU resources will be needed to authenticate
  337. # users.
  338. #
  339. # If not specified, the libc will choose the default number of rounds (5000).
  340. # The values must be inside the 1000-999999999 range.
  341. # If only one of the MIN or MAX values is set, then this value will be used.
  342. # If MIN > MAX, the highest value will be used.
  343. #
  344. # SHA_CRYPT_MIN_ROUNDS 5000
  345. # SHA_CRYPT_MAX_ROUNDS 5000
  346.  
  347. ################# OBSOLETED BY PAM ##############
  348. #                                               #
  349. # These options are now handled by PAM. Please  #
  350. # edit the appropriate file in /etc/pam.d/ to   #
  351. # enable the equivelants of them.
  352. #
  353. ###############
  354.  
  355. #MOTD_FILE
  356. #DIALUPS_CHECK_ENAB
  357. #LASTLOG_ENAB
  358. #MAIL_CHECK_ENAB
  359. #OBSCURE_CHECKS_ENAB
  360. #PORTTIME_CHECKS_ENAB
  361. #SU_WHEEL_ONLY
  362. #CRACKLIB_DICTPATH
  363. #PASS_CHANGE_TRIES
  364. #PASS_ALWAYS_WARN
  365. #ENVIRON_FILE
  366. #NOLOGINS_FILE
  367. #ISSUE_FILE
  368. #PASS_MIN_LEN
  369. #PASS_MAX_LEN
  370. #ULIMIT
  371. #ENV_HZ
  372. #CHFN_AUTH
  373. #CHSH_AUTH
  374. #FAIL_DELAY
  375.  
  376. ################# OBSOLETED #######################
  377. #                                                 #
  378. # These options are no more handled by shadow.    #
  379. #                                                 #
  380. # Shadow utilities will display a warning if they #
  381. # still appear.                                   #
  382. #                                                 #
  383. ###################################################
  384.  
  385. # CLOSE_SESSIONS
  386. # LOGIN_STRING
  387. # NO_PASSWORD_CONSOLE
  388. # QMAIL_DIR
  389.