Page MenuHomeFreeBSD

bsdinstall: ssh lockout protection
Needs RevisionPublic

Authored by allanjude on Mar 9 2018, 1:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 14 2024, 2:36 PM
Unknown Object (File)
Jan 11 2024, 10:11 PM
Unknown Object (File)
Aug 29 2023, 3:20 AM
Unknown Object (File)
Jul 9 2023, 3:14 AM
Unknown Object (File)
May 14 2023, 6:21 AM
Unknown Object (File)
Apr 25 2023, 9:31 AM
Unknown Object (File)
Jan 6 2023, 4:27 PM
Unknown Object (File)
Jan 1 2023, 1:46 PM

Details

Summary

Remind the user to add a user to the wheel group if they enable SSH.
SSH login as root is disabled by default, if no user is added to the wheel
group then it will not be possible to su to root.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 15448
Build 15494: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Mar 10 2018, 3:50 AM
eadler added a subscriber: eadler.
eadler added inline comments.
usr.sbin/bsdinstall/scripts/auto
452

quotes

usr.sbin/bsdinstall/scripts/wheelinvite
38

nit: add quotes around these vars

dteske requested changes to this revision.Apr 15 2018, 11:45 PM
dteske added inline comments.
usr.sbin/bsdinstall/scripts/auto
450

Opening brace on next line plz

453

[ "$WHEEL_MEMBERS" = "wheel:*:0:root" ] || return

Allows you to reduce the level indentation

455

[ "$SSH_ENABLE" = YES ] || return

Allows you to reduce the level indentation

456

Not needed.

Line 34 reads:
f_include $BSDCFG_SHARE/dialog.subr

In dialog.subr, line 2182 in f_dialog_init() function reads:
eval exec $DIALOG_TERMINAL_PASSTHRU_FD\>\&1

For reference, line 47 of dialog.subr reads:
: ${DIALOG_TERMINAL_PASSTHRU_FD:=${TERMINAL_STDOUT_PASSTHRU:-3}}

And finally, lines 2334 to 2337 of dialog.subr read:
case "$DIALOG_SELF_INITIALIZE" in
""|0|[Nn][Oo]|[Oo][Ff][Ff]|[Ff][Aa][Ll][Ss][Ee]) : do nothing ;;
*) f_dialog_init
esac

And for reference, line 91 of dialog.subr reads:
: ${DIALOG_SELF_INITIALIZE=1}

So when you include dialog.subr, unless you have set DIALOG_SELF_INITIALIZE to NULL, 0, NO, Off, or False (all case insensitive), file descriptor 3 (the default unless you modify either TERMINAL_STDOUT_PASSTHRU or DIALOG_TERMINAL_PASSTHRU_FD) is already dup'd to the active stdout for sub-shells to use.

Action-item: remove this line.

457

WHEEL_QUESTION=$( $DIALOG \

--backtitle "FreeBSD Installer" \

Use $DIALOG not dialog. Put all options on own for diff reduction should options change.

458

Move --no-cancel to own line. Move --menu to own line.

459

Don't rely on auto-sizing, use f_dialog_menu_size() from dialog.subr to get an appropriately sized dialog. See wlanconfig in same directory for example.

462

The "1" in "1>3" is unnecessary. Also, best to use the predefined variable for the pre-created file descriptor (below):

2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD

463

Do not close this file descriptor. In a future release when the namespace is conflated, this will do harm to the other modules that expect this file descriptor to be active.

Action item: remove this line.

472

wheelinvite should be dialog based

475

Switch to fallback.

*) # Continue anyway

483โ€“485

f_interactive && check_wheel

usr.sbin/bsdinstall/scripts/wheelinvite
29โ€“35

Why not dialog based?

This revision now requires changes to proceed.Apr 15 2018, 11:45 PM