Compare commits
16 Commits
908f74f917
...
449ca4bb32
Author | SHA1 | Date | |
---|---|---|---|
|
449ca4bb32 | ||
|
93c257e2e9 | ||
|
2fe6786155 | ||
|
c0c9b16cf3 | ||
|
46ce48664b | ||
|
a5ebaa66cf | ||
|
9c24f3496e | ||
|
f0b6a2db74 | ||
|
29a21c6651 | ||
|
5d18f9cacd | ||
|
8c49091ed6 | ||
|
8cd0429ce8 | ||
|
2a8b6a1088 | ||
|
e68bb5f429 | ||
|
a8f53c8a3b | ||
|
27cc38a9e0 |
@ -4,16 +4,16 @@
|
|||||||
|
|
||||||
### Connection settings
|
### Connection settings
|
||||||
Port 222
|
Port 222
|
||||||
ListenAddress your.private.ipv4.address
|
#ListenAddress your.private.ipv4.address
|
||||||
ListenAddress [your:private:ipv6:address:use:square:brackets]
|
#ListenAddress [your:private:ipv6:address:use:square:brackets]
|
||||||
TCPKeepAlive no
|
TCPKeepAlive no
|
||||||
ClientAliveInterval 60
|
ClientAliveInterval 60
|
||||||
ClientAliveCountMax 30
|
ClientAliveCountMax 30
|
||||||
Protocol 2
|
Protocol 2
|
||||||
|
|
||||||
### Authentication settings
|
### Authentication settings
|
||||||
HostKey /etc/ssh/ed25519.key
|
#HostKey /etc/ssh/ed25519.key
|
||||||
HostKey /etc/ssh/RSA4096.key
|
#HostKey /etc/ssh/RSA4096.key
|
||||||
#PasswordAuthentication no
|
#PasswordAuthentication no
|
||||||
PasswordAuthentication yes
|
PasswordAuthentication yes
|
||||||
PermitEmptyPasswords no
|
PermitEmptyPasswords no
|
||||||
@ -29,7 +29,7 @@ MaxSessions 5
|
|||||||
PermitRootLogin yes
|
PermitRootLogin yes
|
||||||
|
|
||||||
### Program settings
|
### Program settings
|
||||||
Banner /etc/ssh/banner
|
#Banner /etc/ssh/banner
|
||||||
LogLevel VERBOSE
|
LogLevel VERBOSE
|
||||||
X11Forwarding yes
|
X11Forwarding yes
|
||||||
PrintMotd no
|
PrintMotd no
|
||||||
|
122
customize.sh
122
customize.sh
@ -3,66 +3,120 @@
|
|||||||
#######
|
#######
|
||||||
### Copy customization files to their proper locations after backing up
|
### Copy customization files to their proper locations after backing up
|
||||||
### original files
|
### original files
|
||||||
|
###
|
||||||
|
### Script by: Asif Bacchus for mytechiethoughts.com
|
||||||
|
### Exclusively available from git.asifbacchus.app
|
||||||
|
### Some rights reserved.
|
||||||
|
###
|
||||||
|
### Anyone is allowed to use and alter this script and any or all accompanying
|
||||||
|
### files for their own needs as long as the intent as stated at the beginning
|
||||||
|
### of this comment block remains the same and credit is given to the author
|
||||||
|
### or the 'mytechiethoughts.com' website.
|
||||||
|
###
|
||||||
|
### Neither the author or anyone affiliated with 'mytechiethoughts.com' accepts
|
||||||
|
### any liability whatsoever arising from using or even thinking about using
|
||||||
|
### this script or any accompanying files for any purpose whether intended,
|
||||||
|
### incidental or otherwise.
|
||||||
|
###
|
||||||
|
### Please refer to https://mytechiethoughts.com/<address_of_blog_post>
|
||||||
|
### for more information about this script and its accompanying files.
|
||||||
#######
|
#######
|
||||||
|
|
||||||
### Verify this script is running as root, otherwise exit with notification
|
|
||||||
|
# colour definitions
|
||||||
|
norm="\e[0m"
|
||||||
|
yellow="\e[93m"
|
||||||
|
cyan="\e[96m"
|
||||||
|
mag="\e[95m"
|
||||||
|
err="\e[1;31m"
|
||||||
|
ok="\e[1;32m"
|
||||||
|
|
||||||
|
# allow base copy-path for debugging, otherwise default to '' as base (i.e. use
|
||||||
|
# root as base)
|
||||||
|
if [ -n "${1}" ]; then
|
||||||
|
path="${1%/}"
|
||||||
|
echo -e "\n${err}BASE PATH:${norm} ${path}"
|
||||||
|
echo -e "${err}All files will be copied to subdirectories beneath this 'base path' instead"
|
||||||
|
echo -e "of the correct locations. This should only be done for testing!${norm}\n"
|
||||||
|
else
|
||||||
|
unset path
|
||||||
|
fi
|
||||||
|
|
||||||
|
### verify this script is running as root, otherwise exit with notification
|
||||||
if [ $(id -u) -ne 0 ]; then
|
if [ $(id -u) -ne 0 ]; then
|
||||||
echo -e "\n\e[1;31mThis script MUST be run as ROOT. Exiting\e[0m"
|
echo -e "\n${err}This script MUST be run as ROOT. Exiting${norm}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### Let user know what's happening
|
|
||||||
echo -e "\nThis script will copy TEMPLATE files to various locations in order to customize your system. Backups will be created in-place with the extension '.original'"
|
|
||||||
echo -e "\n\e[0;33mPlease note: It's still up to you to customize the template files with settings appropriate to your environment!"
|
|
||||||
echo -e "\n\e[0;36mDetails about template files are in the readme.md files within each directory in this archive.\e[0m\n"
|
|
||||||
|
|
||||||
### Copy files to proper locations
|
### let user know what's happening
|
||||||
|
echo -e "\n${norm}This script will copy TEMPLATE files to various locations in order to customize"
|
||||||
|
echo "your system. Backups will be created in-place with the extension '.original'"
|
||||||
|
echo -e "\n${yellow}Please note: It's still up to you to customize the template files with settings"
|
||||||
|
echo "appropriate to your environment!"
|
||||||
|
echo -e "\n${cyan}Details about template files are in the readme.md files within each directory"
|
||||||
|
echo -e "in this archive.${norm}\n"
|
||||||
|
|
||||||
## Copy root's .bashrc
|
### copy files to proper locations
|
||||||
echo -e "\ncopying .bashrc to /root..."
|
echo -e "${mag}---------------------${norm}"
|
||||||
|
echo "(please note any errors below)"
|
||||||
|
|
||||||
|
|
||||||
|
## copy clean .bashrc for root user
|
||||||
|
echo -e "copying ${yellow}.bashrc${norm} to ${yellow}${path}/root${norm}"
|
||||||
# backup
|
# backup
|
||||||
cp -f /root/.bashrc /root/.bashrc.original
|
cp -f /root/.bashrc ${path}/root/.bashrc.original
|
||||||
# copy new
|
# copy new
|
||||||
cp -f config/root/.bashrc /root/.bashrc
|
cp -f config/root/.bashrc ${path}/root/.bashrc
|
||||||
echo "...done"
|
|
||||||
|
|
||||||
## Copy profile template files and skel files
|
## copy profile template file
|
||||||
echo -e "\ncopying default bash profile files..."
|
echo -e "copying ${yellow}profile${norm} to ${yellow}${path}/etc/profile${norm}"
|
||||||
# backup
|
# backup
|
||||||
cp -f /etc/profile /etc/profile.original
|
cp -f /etc/profile ${path}/etc/profile.original
|
||||||
cp -f /etc/bash.bashrc /etc/bash.bashrc.original
|
|
||||||
cp -f /etc/skel/.bashrc /etc/skel/.bashrc.original
|
|
||||||
# copy new
|
# copy new
|
||||||
cp -f config/etc/profile /etc/profile
|
cp -f config/etc/profile ${path}/etc/profile
|
||||||
cp -f config/etc/bash.bashrc /etc/bash.bashrc
|
|
||||||
cp -f config/etc/skel/.bashrc /etc/skel/.bashrc
|
## copy updated bash.bashrc
|
||||||
echo "...done"
|
echo -e "copying ${yellow}bash.bashrc${norm} to ${yellow}${path}/etc/bash.bashrc${norm}"
|
||||||
|
# backup
|
||||||
|
cp -f /etc/bash.bashrc ${path}/etc/bash.bashrc.original
|
||||||
|
# copy new
|
||||||
|
cp -f config/etc/bash.bashrc ${path}/etc/bash.bashrc
|
||||||
|
|
||||||
|
## copy updated skel .bashrc
|
||||||
|
echo -e "copying ${yellow}.bashrc${norm} to ${yellow}${path}/etc/skel/.bashrc${norm}"
|
||||||
|
# backup
|
||||||
|
cp -f /etc/skel/.bashrc ${path}/etc/skel/.bashrc.original
|
||||||
|
# copy new
|
||||||
|
cp -f config/etc/skel/.bashrc ${path}/etc/skel/.bashrc
|
||||||
|
|
||||||
|
|
||||||
## copy nano settings
|
## copy nano settings
|
||||||
echo -e "\ncopying nano default settings..."
|
echo -e "\ncopying ${yellow}nanorc${norm} to ${yellow}${path}/etc/nanorc${norm}"
|
||||||
# backup
|
# backup
|
||||||
cp -f /etc/nanorc /etc/nanorc.original
|
cp -f /etc/nanorc ${path}/etc/nanorc.original
|
||||||
# copy new
|
# copy new
|
||||||
cp -f config/etc/nanorc /etc/nanorc
|
cp -f config/etc/nanorc ${path}/etc/nanorc
|
||||||
echo "...done"
|
|
||||||
|
|
||||||
## copy timesync
|
## copy timesync
|
||||||
echo -e "\ncopying timesync configuration..."
|
echo -e "\ncopying ${yellow}timesyncd.conf${norm} to ${yellow}${path}/etc/systemd/timesyncd.conf${norm}"
|
||||||
# backup
|
# backup
|
||||||
cp -f /etc/systemd/timesyncd.conf /etc/systemd/timesyncd.conf.original
|
cp -f /etc/systemd/timesyncd.conf ${path}/etc/systemd/timesyncd.conf.original
|
||||||
# copy new
|
# copy new
|
||||||
cp -f config/etc/systemd/timesyncd.conf /etc/systemd/timesyncd.conf
|
cp -f config/etc/systemd/timesyncd.conf ${path}/etc/systemd/timesyncd.conf
|
||||||
echo "...done"
|
|
||||||
|
|
||||||
## copy sshd configuration
|
## copy sshd configuration
|
||||||
echo -e "\ncopying sshd configuration..."
|
echo -e "\ncopying ${yellow}sshd_config${norm} to ${yellow}${path}/etc/ssh/sshd_config${norm}"
|
||||||
# backup
|
# backup
|
||||||
cp -f /etc/ssh/sshd_config /etc/ssh/sshd_config.original
|
cp -f /etc/ssh/sshd_config ${path}/etc/ssh/sshd_config.original
|
||||||
# copy new
|
# copy new
|
||||||
cp -f config/etc/ssh/sshd_config /etc/ssh/sshd_config
|
cp -f config/etc/ssh/sshd_config ${path}/etc/ssh/sshd_config
|
||||||
echo "...done"
|
|
||||||
|
|
||||||
### Exit gracefully
|
### Exit gracefully
|
||||||
echo -e "\n\e[0;32mAll done!\n\e[0m"
|
echo -e "${mag}---------------------${norm}"
|
||||||
|
echo -e "\n${ok}All done!${norm}\n"
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
Loading…
Reference in New Issue
Block a user