Spaces:
Paused
Paused
Update start.sh
Browse files
start.sh
CHANGED
|
@@ -4,9 +4,11 @@
|
|
| 4 |
print_host_details() {
|
| 5 |
#echo "0.0.0.0 abc" | sudo tee -a /etc/hosts
|
| 6 |
echo "* The hostname of this container is: $(cat /etc/hostname). PWD $(pwd)"
|
| 7 |
-
echo "* The host of this container is: $(cat /etc/hosts)"
|
| 8 |
echo "* The Sudoers of this container is: $(cat /etc/sudoers)"
|
| 9 |
echo "* ID of the user running the script:($whoami) *ID : $(id -u) * Group: $(id -g)"
|
|
|
|
|
|
|
| 10 |
echo "* Status of Admin: $(id admin 2>/dev/null || echo 'Admin user not found')"
|
| 11 |
}
|
| 12 |
|
|
@@ -77,8 +79,8 @@ add_admin_authorized_keys() {
|
|
| 77 |
echo "* Authorised Keys: $(cat /home/admin/.ssh/authorized_keys)"
|
| 78 |
echo "* Known HOST File :$(cat /home/admin/.ssh/known_hosts)"
|
| 79 |
#chmod 600 /home/admin/.ssh/authorized_keys || { echo "Failed to set authorized_keys permissions"; exit 1; }
|
| 80 |
-
echo "password" || su - admin
|
| 81 |
-
echo "I am $(whoami)"
|
| 82 |
}
|
| 83 |
|
| 84 |
# Function to add SSH private key to the SSH agent
|
|
|
|
| 4 |
print_host_details() {
|
| 5 |
#echo "0.0.0.0 abc" | sudo tee -a /etc/hosts
|
| 6 |
echo "* The hostname of this container is: $(cat /etc/hostname). PWD $(pwd)"
|
| 7 |
+
echo "* The host File of this container is: $(cat /etc/hosts)"
|
| 8 |
echo "* The Sudoers of this container is: $(cat /etc/sudoers)"
|
| 9 |
echo "* ID of the user running the script:($whoami) *ID : $(id -u) * Group: $(id -g)"
|
| 10 |
+
echo "* Changing User to Admin :$(echo "password" || su - admin)"
|
| 11 |
+
echo "* Current User WHO AM I $(whoami)"
|
| 12 |
echo "* Status of Admin: $(id admin 2>/dev/null || echo 'Admin user not found')"
|
| 13 |
}
|
| 14 |
|
|
|
|
| 79 |
echo "* Authorised Keys: $(cat /home/admin/.ssh/authorized_keys)"
|
| 80 |
echo "* Known HOST File :$(cat /home/admin/.ssh/known_hosts)"
|
| 81 |
#chmod 600 /home/admin/.ssh/authorized_keys || { echo "Failed to set authorized_keys permissions"; exit 1; }
|
| 82 |
+
#echo "password" || su - admin
|
| 83 |
+
#echo "I am $(whoami)"
|
| 84 |
}
|
| 85 |
|
| 86 |
# Function to add SSH private key to the SSH agent
|