Skip to content

Commit

Permalink
sharedfsvm: update /etc/hosts at first
Browse files Browse the repository at this point in the history
  • Loading branch information
weizhouapache committed Sep 4, 2024
1 parent 448a37c commit d3f6cf6
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions systemvm/debian/opt/cloud/bin/setup/sharedfsvm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,19 @@ setup_sharedfsvm() {
update-alternatives --set arptables /usr/sbin/arptables-legacy
update-alternatives --set ebtables /usr/sbin/ebtables-legacy

log_it "Setting up entry in hosts"
sed -i /$NAME/d /etc/hosts
echo "$ETH0_IP $NAME" >> /etc/hosts

# set default ssh port and restart sshd service
sed -i 's/3922/22/g' /etc/ssh/sshd_config
systemctl restart ssh

sed -i '/- ssh$/s/- ssh/- [ssh, always]/' /etc/cloud/cloud.cfg

> /root/.ssh/authorized_keys
swapoff -a
sudo sed -i '/ swap / s/^/#/' /etc/fstab
log_it "Swap disabled"

log_it "Setting up entry in hosts"
sed -i /$NAME/d /etc/hosts
echo "$ETH0_IP $NAME" >> /etc/hosts

echo "export PATH='$PATH:/opt/bin/'">> ~/.bashrc

disable_rpfilter
Expand Down

0 comments on commit d3f6cf6

Please sign in to comment.