Lines Matching +full:ssh +full:. +full:bin
5 # System startup script run by init on autoboot or after single-user.
7 # is the controlling terminal. This is called with _PATH_BSHELL which
8 # must be an mksh(1).
10 export HOME=/ LC_CTYPE=en_US.UTF-8 PATH=/sbin:/bin:/usr/sbin:/usr/bin
14 # Subroutines (have to come first).
29 typeset _lc=$2 # login.conf name
33 n=$(getcap -f /etc/login.conf -s $_lc$s daemon 2>/dev/null)
53 test -s /etc/sysctl.conf || return
55 set -- $(stripcom /etc/sysctl.conf)
60 (kern.maxproc=*)
63 (kern.maxfiles=*)
72 test -s /etc/mixerctl.conf || return
74 set -- $(stripcom /etc/mixerctl.conf)
84 test -x /sbin/wsconsctl -a -s /etc/wsconsctl.conf || return
87 set -- $(stripcom /etc/wsconsctl.conf)
136 # shell catches SIGQUIT (3) and returns to single user after fsck.
144 echo Received shutdown request.
151 dd if=/var/db/host.random of=/dev/arandom 2>/dev/null
154 >/var/db/host.random 2>/dev/null
155 chmod 600 /var/db/host.random
157 if [ $? -eq 0 -a -f /etc/rc.shutdown ]; then
158 echo /etc/rc.shutdown in progress...
159 . /etc/rc.shutdown
160 echo /etc/rc.shutdown complete.
163 for hn in /etc/hostname.carp[0-9]*; do
165 if=${hn#/etc/hostname.}
174 dd if=/dev/arandom count=1 >>/var/db/host.random 2>/dev/null
178 echo single user: not running /etc/rc.shutdown
186 echo Sorry, WirrtualBox is not supported.
194 # Configure ccd devices.
195 [[ -f /etc/ccd.conf ]] && ccdconfig -C
197 # Configure raid devices.
199 [[ -f /etc/raid${dev}.conf ]] && \
200 raidctl -c /etc/raid${dev}.conf raid$dev
203 # Check parity on raid devices.
212 . /etc/rc.conf
243 echo -n Disabling HDD hardware write caches...
253 echo .
258 echo Fast boot: skipping disk checks.
260 echo Automatic boot in progress: starting file system checks.
269 echo Rebooting...
279 echo Boot interrupted.
293 trap "echo Boot interrupted.; exit 1" 3
303 echo -n ' to remount read-write! <forcing...>'
343 [[ -x /sbin/ldconfig && -d /var/run/. ]] && /sbin/ldconfig
345 # set flags on ttys. (do early, in case they use tty for SLIP in netstart)
362 if [[ "$(sysctl vfs.mounts.nfs 2>/dev/null)" = *[1-9]* ]]; then
374 # configure wscons(4) early, in case someone needs to interrupt e.g. dhclient
379 if [ -f /etc/resolv.conf.save ]; then
380 mv /etc/resolv.conf.save /etc/resolv.conf
381 touch /etc/resolv.conf
383 [[ -e /etc/rc.netselect ]] && . /etc/rc.netselect
384 . /etc/netstart
402 if [[ $arptables = YES && -s /etc/arp.conf ]]; then
404 arp -f /etc/arp.conf
407 # read old random seed; if there's no /var/db/host.random, make
412 cat /var/db/host.random >/dev/urandom
414 dd of=/var/db/host.random
415 chmod 600 /var/db/host.random
423 dd if=/dev/arandom count=3 >>/var/db/host.random
429 rm -f /var/spool/lock/LCK.*
435 echo creating runtime link editor directory cache.
440 PATH=/sbin:/bin:/usr/sbin:/usr/bin
444 dmesg | tee /var/run/dmesg.boot | cksum -ba rmd160 >/dev/wrandom
448 grep ':/var/anoncvs.*:/usr/libexec/anoncvssh$' /etc/master.passwd |&
452 (( i )) && if [[ -d /var/anoncvs/dev/. ]]; then
465 if [[ $named_flags != NO && -d /var/named/dev/. ]]; then
469 if [[ -d /var/empty/. ]]; then
479 # $isakmpd_flags is imported from /etc/rc.conf;
480 # If $isakmpd_flags == NO, isakmpd isn't run.
491 # $portmap is imported from /etc/rc.conf;
492 # if $portmap == YES, the portmapper is started.
499 # $nfs_server is imported from /etc/rc.conf;
508 echo -n ' rpc.lockd'; rpc.lockd
522 # $timed_flags is imported from /etc/rc.conf;
523 # if $timed_flags == NO, timed isn't run.
532 echo .
542 # to the crash directory if core dumps are to be saved.
548 echo done.
554 [[ -e /var/db/kvm_bsd.new ]] && mv -f /var/db/kvm_bsd.new /var/db/kvm_bsd.db
561 echo .
567 [[ -f /etc/ptmp ]] && logger -s -p auth.err \
581 find . ! -name . ! -name lost+found ! -name quota.user \
582 ! -name quota.group -execdir rm -rf -- {} \; -type d -prune)
588 for d in /tmp/.X11-unix /tmp/.ICE-unix; do
594 echo "Error: $d exists and isn't a directory."
599 [[ -f /etc/rc.securelevel ]] && . /etc/rc.securelevel
602 sysctl kern.securelevel=$securelevel
606 x=$(sysctl -n kern.version | sed 1q)
613 .
625 if [[ -x /usr/libexec/vi.recover && -x /usr/bin/perl && \
626 -d /var/tmp/vi.recover ]]; then
627 echo preserving editor files; /usr/libexec/vi.recover
630 if [[ -e /etc/rc.once ]]; then
632 mksh /etc/rc.once
636 if [[ ! -s /etc/ssl/private/default.key && -s /etc/ssh/ssh_host_rsa_key ]]; then
637 print "openssl: using old SSH host RSA key"
638 rm -f /etc/ssl/{def{ault,lt-ca}.cer,private/default.key}
639 cat /etc/ssh/ssh_host_rsa_key >/etc/ssl/private/default.key
640 chmod 600 /etc/ssl/private/default.key
642 if [[ ! -s /etc/ssl/private/default.key ]]; then
643 print -n "openssl: generating new host RSA key... "
644 rm -f /etc/ssl/{def{ault,lt-ca}.cer,private/default.key}
645 # XXX 6000-8000 is recommended... choose less to be nice to old boxen
646 if openssl genrsa -out /etc/ssl/private/default.key 4096 \
648 chmod 600 /etc/ssl/private/default.key
649 rm -f /etc/ssh/ssh_host_rsa_key
650 print done.
652 print failed.
655 if [[ ! -s /etc/ssl/default.cer || ! -s /etc/ssl/deflt-ca.cer ]]; then
656 print -n "openssl: generating new host X.509v3 certificate... "
657 rm -f /etc/ssl/def{ault,lt-ca}.cer
659 -key /etc/ssl/private/default.key \
660 -x509 -out /etc/ssl/default.cer
661 chmod 644 /etc/ssl/default.cer
662 cp /etc/ssl/default.cer /etc/ssl/deflt-ca.cer
665 if [[ ! -s /etc/ssh/ssh_host_rsa_key ]]; then
666 print -n "ssh-keygen: installing host RSA key... "
667 cp -f /etc/ssl/private/default.key /etc/ssh/ssh_host_rsa_key
668 rm -f /etc/ssh/ssh_host_rsa_key.pub
669 print done.
671 if [[ ! -s /etc/ssh/ssh_host_rsa_key.pub ]]; then
672 print -n "ssh-keygen: installing host public key... "
673 print -r -- $(ssh-keygen -yf /etc/ssh/ssh_host_rsa_key) \
674 $(hostname) host key >/etc/ssh/ssh_host_rsa_key.pub
675 chmod 600 /etc/ssh/ssh_host_rsa_key
676 chmod 644 /etc/ssh/ssh_host_rsa_key.pub
677 print done.
682 # $routed_flags are imported from /etc/rc.conf.
683 # If $routed_flags == NO, routed isn't run.
684 # Same for the other dæmons.
702 if [[ $dhcpd_flags != NO && -f /etc/dhcpd.conf ]]; then
703 touch /var/db/dhcpd.leases
704 [[ -f /etc/dhcpd.interfaces ]] && \
705 dhcpd_ifs=$(stripcom /etc/dhcpd.interfaces)
710 fw=$(sysctl -n net.inet6.ip6.forwarding)
728 # if $rwhod == YES, rwhod is run.
737 # $sendmail_flags is imported from /etc/rc.conf;
738 # If $sendmail_flags == NO or /etc/mailer.conf doesn't exist, then
739 # sendmail isn't run. We call sendmail with a full path so that
740 # SIGHUP works. Note that /usr/sbin/sendmail may actually call a
741 # mailer other than sendmail, depending on /etc/mailer.conf.
742 if [[ $sendmail_flags != NO && -s /etc/mailer.conf ]]; then
749 rm -f /var/www/logs/{ssl_mutex,httpd.lock,accept.lock}.*
765 if [[ $inetd = YES && -s /etc/inetd.conf ]]; then
784 # rarpd isn't run.
790 # bootparamd isn't run.
792 echo -n ' rpc.bootparamd'; rpc.bootparamd $bootparamd_flags
795 # If $rbootd_flags == NO or /etc/rbootd.conf doesn't exist, then
796 # rbootd isn't run.
797 if [[ $rbootd_flags != NO && -s /etc/rbootd.conf ]]; then
805 echo .
812 [[ -e /etc/ttys ]] || install -c -o 0 -g 0 -m 644 /etc/ttys.dist /etc/ttys
814 grep -q '^console.*acs\.[0-9s]' /etc/ttys >/dev/null 2>&1 && \
816 /^console/s/acs\.[0-9]*/acs.${consspeed}/
820 [[ -f /etc/rc.local ]] && . /etc/rc.local
822 # Only if it exists and is an unused ram disc array.
824 # we checksum the first 2 pages instead of a memcmp.
829 echo Setting up ssh-agent directories...
830 mkdir -m 0755 /var/run/ssh-agent
831 chown root:daemon /var/run/ssh-agent
833 mkdir -m 0700 /var/run/ssh-agent/$luser
834 chown $luser /var/run/ssh-agent/$luser
835 rm -f /var/run/ssh-agent/$luser/agent
867 echo .
871 # Alternatively, on some architectures, xdm may be started in /etc/ttys.
872 if [[ $xdm_flags != NO && -x /usr/X11R6/bin/xdm ]]; then
873 echo starting xdm...; /usr/X11R6/bin/xdm $xdm_flags