Skip to content

Commit

Permalink
Add script start_sshd.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
stevleibelt committed Dec 16, 2023
1 parent 28626cb commit 690f4bd
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

* Added content of repository >>https://github.com/ezonakiusagi/bht<< below `software`
* Added packages mailx, ksh and nmon
* Added script `start_sshd.sh`

### Changed

Expand Down
5 changes: 4 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,17 @@ function add_files ()
cp "${PATH_TO_THIS_SCRIPT}/source/replace_zfsbootmenu.sh" "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/zfsbootmenu/"
exit_if_last_exit_code_is_not_zero ${?} "Copy of >>${PATH_TO_THIS_SCRIPT}/source/replace_zfsbootmenu.sh<< to >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/zfsbootmenu/<< failed."


_echo_if_be_verbose " Adding repository >>general_howtos<< "
git clone https://github.com/stevleibelt/general_howtos "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/document/general_howtos"
exit_if_last_exit_code_is_not_zero ${?} "Checkout and creation of directory >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/document/general_howtos<< failed."

_echo_if_be_verbose " Adding repository >>bulk_hdd_testing<< "
git clone https://github.com/ezonakiusagi/bht "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/bulk_hdd_testing"
exit_if_last_exit_code_is_not_zero ${?} "Checkout and creation of directory >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/bulk_hdd_testing<< failed."

_echo_if_be_verbose " Adding script >>start_sshd.sh<< "
cp "${PATH_TO_THIS_SCRIPT}/source/start_sshd.sh" "${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/"
exit_if_last_exit_code_is_not_zero ${?} "Copy of >>${PATH_TO_THIS_SCRIPT}/source/start_sshd.sh<< to >>${PATH_TO_THE_ARCHLIVE_ROOT_USER}/software/<< failed."
fi

_echo_if_be_verbose ":: Finished adding files"
Expand Down
21 changes: 21 additions & 0 deletions source/start_sshd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash
#####
# Set's root password and starts sshd
####
# @since: 2023-12-16
# @author: stev leibelt <artodeto@bazzline.net>
####

function _main ()
{
echo ":: Setting root password"
passwd
echo ":: Adapting sshd and starting it"
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
systemctl enable --now sshd

echo ":: Use root@<ip_listed_below> from a remote machine to log in"
ip a | grep inet
}

_main "${@}"

0 comments on commit 690f4bd

Please sign in to comment.