blob: d7ccb78ffdec8a444543aebffbeb2706f7cd6c16 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#!/bin/sh
# update and install tmux and git
pacman -Sy --noconfirm
pacman -S --noconfirm tmux git
# change the root password
echo "root:welcome" | chpasswd
# find the hostname from the file
hostname=$(</etc/hostname)
# identify which interface is up, then find the ip address
interface_up=$(ip addr show | grep -v "lo: " | grep "state UP" -B2 | head -n1 | awk '{print $2}' | sed 's/://')
ipaddress=$(ip addr show $(interface_up) | grep 'inet ' | awk '{print $2}' | cut -d/ -f1)
# start the ssh daemon
systemctl start sshd
echo ""; echo ""; echo "init complete. "
echo "you may ssh root@$hostname or ssh root@$ipaddress using the password 'welcome'"
|