Last active
April 8, 2021 22:16
-
-
Save paulc/1d69f6e7b35f3b7e61a7 to your computer and use it in GitHub Desktop.
FreeBSD 10.0 VM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pw usermod -n root -s /bin/sh | |
# export ENV=${HOME}/.shrc | |
export EDITOR=vi | |
set -o emacs | |
alias ls="ls -F" | |
PS1="[${USER}@\H] \w \$ " |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# BEFORE: DAEMON | |
# PROVIDE: ezjail.example.config | |
# | |
# ezjail flavour example | |
. /etc/rc.subr | |
name=ezjail.flavour.example | |
start_cmd=flavour_setup | |
set_shrc() { | |
[ $# -ne 1 ] && return | |
su -l $1 -c "cat > .shrc" <<-EOM | |
export EDITOR=vi | |
set -o emacs | |
alias ls="ls -F" | |
PS1="[\${USER}@\H] \w \\$ " | |
EOM | |
} | |
flavour_setup() { | |
# Remove traces of ourself | |
# N.B.: Do NOT rm $0, it points to /etc/rc | |
########################## | |
rm -f "/etc/rc.d/ezjail.flavour.example" | |
# Groups | |
######### | |
# Users | |
######## | |
pw usermod -n root -s /bin/sh -m -k /usr/share/skel | |
su -l root -c "echo export ENV=/root/.shrc >> .profile" | |
set_shrc root | |
pw useradd -n jail -s /bin/sh -m -G wheel -c 'Jail User' -k /usr/share/skel | |
set_shrc jail | |
# Files | |
######## | |
# Packages | |
########### | |
ASSUME_ALWAYS_YES=YES pkg bootstrap -f | |
# Postinstall | |
############## | |
} | |
run_rc_command "$1" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pkg bootstrap | |
pkg install ezjail | |
pkg install mdnsresponder | |
/usr/local/etc/rc.d/mdnsresponderposix | |
-command_args="-b -P ${mdnsresponderposix_pidfile}" | |
+command_args="-b -P ${mdnsresponderposix_pidfile} ${mdnsresponderposix_flags}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ext_if = "{ em0 }" | |
nat_if = "{ lo1 }" | |
nat pass on $ext_if from $nat_if to any -> $ext_if |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# System | |
fsck_y_enable="YES" | |
dumpdev="AUTO" | |
# Network | |
hostname="freebsd10" | |
ifconfig_em0="DHCP" | |
cloned_interfaces="lo1" | |
ipv4_addrs_lo1="192.168.1.1-8/24" | |
# Services | |
sshd_enable="YES" | |
#sshd_flags="-o ListenAddress=$(ifconfig em0 | awk '/inet / { print $2 }' )" | |
sshd_flags="-o ListenAddress=10.0.1.127" | |
syslogd_flags="-s -b 127.0.0.1" | |
mdnsresponderposix_enable="YES" | |
mdnsresponderposix_flags="-n $(hostname) -t _ssh._tcp. -p 22" | |
pf_enable="YES" | |
ntpdate_enable="YES" | |
ezjail_enable="YES" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment