Skip to content

Commit

Permalink
roll in cos7
Browse files Browse the repository at this point in the history
  • Loading branch information
georgalis committed Jun 30, 2022
1 parent f24635a commit d77e387
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 11 deletions.
5 changes: 4 additions & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

# Unlimited use with this notice. (C) 2004-2018 George Georgalis <george@galis.org>
# (c) 2004-2022 George Georgalis <george@galis.org> unlimited use with this notice

Copyright and use license are stored in respective files of this repo. In cases
where they are not and you require them, apply this file.

31 changes: 31 additions & 0 deletions boot/cos7/hostroot
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/bin/sh

# REQUIRE: time
# BEFORE: etc
# PROVIDE: hostroot
# KEYWORD: cos7-boot

set -e

chkerr () { [ "$*" ] && { stderr ">>> $* <<<" ; return 1 ;} || true ;} #:> err stderr args return 1, noop if null

[ -e /root/root.pub ] || chkerr "It only makes sense to run this if we have a root pub key ready..."

install -m 755 -o root -g wheel -d /etc/ssh/auth
install -m 644 -o root -g wheel /root/root.pub /etc/ssh/auth/
mv /root/root.pub /root/root.pub~

##:: Reconfigure sshd to allow root login and disallow password authentication.
[ -e /etc/ssh/sshd_config-orig ] || cp -p /etc/ssh/sshd_config /etc/ssh/sshd_config-orig
sed '
s/.*PermitRootLogin.*/PermitRootLogin yes/
s/.*PasswordAuthentication.*/PasswordAuthentication no/
s/.*UsePam.*/UsePam no/
s=.*AuthorizedKeysFile.*=AuthorizedKeysFile /etc/ssh/auth/%u.pub=
' /etc/ssh/sshd_config >/etc/ssh/sshd_config-tmp \
&& mv /etc/ssh/sshd_config-tmp /etc/ssh/sshd_config

systemctl enable sshd || true
systemctl stop sshd || true
systemctl start sshd
# systemctl status sshd
12 changes: 12 additions & 0 deletions boot/cos7/yum-desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# REQUIRE: yum-epel
# BEFORE:
# PROVIDE: yum-desktop
# KEYWORD: cos7

set -e

yum -y groupinstall Xfce
yum -y install xrdp xterm firefox

11 changes: 11 additions & 0 deletions boot/cos7/yum-epel
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh

# REQUIRE:
# BEFORE:
# PROVIDE: yum-epel
# KEYWORD: cos7

set -e

yum install epel-release -y

18 changes: 18 additions & 0 deletions boot/cos7/yum-main
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

# REQUIRE:
# BEFORE:
# PROVIDE: yum-main
# KEYWORD: cos7

set -e

yum -y install fping mtr ndjbdns net-tools nmap rsync telnet lua
yum -y install bc gnupg2 lsof rcs tmux vim-enhanced yum-utils git

yum -y install gnuplot rrdtool units aspell

yum -y groupinstall development
yum -y install ShellCheck
# npm nodejs

12 changes: 12 additions & 0 deletions boot/cos7/yum-min
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

# REQUIRE:
# BEFORE:
# PROVIDE: yum-min
# KEYWORD: cos7

set -e

yum -y install fping mtr ndjbdns net-tools nmap rsync telnet lua
yum -y install bc gnupg2 lsof rcs tmux vim-enhanced yum-utils git

4 changes: 2 additions & 2 deletions boot/ubt/hostroot
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

set -e

chkerr () { [ -n "$*" ] && echo "ERR > > > $0: $* < < < " >&2 && exit 1 ;}
chkerr () { [ "$*" ] && { stderr ">>> $* <<<" ; return 1 ;} || true ;} #:> err stderr args return 1, noop if null

[ -e /root/root.pub ] || chkerr "It only makes sense to run this if we have a root pub key ready..."

Expand All @@ -25,7 +25,7 @@ sed '
' /etc/ssh/sshd_config >/etc/ssh/sshd_config-tmp \
&& mv /etc/ssh/sshd_config-tmp /etc/ssh/sshd_config

systemctl enable sshd || true
systemctl stop sshd || true
systemctl start sshd
systemctl enable sshd
# systemctl status sshd
14 changes: 6 additions & 8 deletions skel/.bash_profile
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
# ~/.bash_profile

# Unlimited use with this notice (c) George Georgalis <george@galis.org>
# (c) 2006-2022 George Georgalis <george@galis.org> unlimited use with this notice

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# source any legacy rc
test -e ~/.bashrc && . ~/.bashrc || true

# User specific environment and startup programs

[ -e "$HOME/.profile" ] && . "$HOME/.profile"
# source root env
test -e ~/.profile && . ~/.profile

# no further env setup here.

0 comments on commit d77e387

Please sign in to comment.