Restart ssh server
This commit is contained in:
parent
06e8f1e385
commit
aaeedbe60c
1 changed files with 5 additions and 3 deletions
|
|
@ -38,13 +38,15 @@ function create_container {
|
|||
}
|
||||
|
||||
function add_ssh {
|
||||
CONTAINER_PATH=$1
|
||||
echo -n "Enter ssh listening port: "
|
||||
read PORT
|
||||
|
||||
echo "Editing ssh config"
|
||||
# edit ssh config
|
||||
sed -i 's/^#Port .*/Port '"$PORT"'/' $1/etc/ssh/sshd_config
|
||||
sed -i 's/^#PermitRootLogin .*/PermitRootLogin yes/' $1/etc/ssh/sshd_config
|
||||
sed -i 's/^#Port .*/Port '"$PORT"'/' $CONTAINER_PATH/etc/ssh/sshd_config
|
||||
sed -i 's/^#PermitRootLogin .*/PermitRootLogin yes/' $CONTAINER_PATH/etc/ssh/sshd_config
|
||||
# Restart ssh in order to load changes
|
||||
systemd-nspawn -D $CONTAINER_PATH systemctl restart ssh
|
||||
}
|
||||
|
||||
function dotfiles {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue