Spaces:
Paused
Paused
Update start.sh
Browse files
start.sh
CHANGED
|
@@ -7,7 +7,7 @@ print_host_details() {
|
|
| 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 "
|
| 11 |
echo "* Current User WHO AM I $(whoami)"
|
| 12 |
echo "* Status of Admin: $(id admin 2>/dev/null || echo 'Admin user not found')"
|
| 13 |
}
|
|
@@ -15,7 +15,7 @@ print_host_details() {
|
|
| 15 |
start_ssh_service() {
|
| 16 |
if ! pgrep -x "sshd" >/dev/null; then
|
| 17 |
echo "* Starting SSH server on port 2222 *"
|
| 18 |
-
/usr/sbin/sshd -p 2222 || { echo "Failed to start SSH server"; exit 1; }
|
| 19 |
#/usr/sbin/sshd -D || { echo "Failed to start SSH server"; exit 1; }
|
| 20 |
else
|
| 21 |
echo "* SSH server is already running *"
|
|
|
|
| 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 "toor" || su - root)"
|
| 11 |
echo "* Current User WHO AM I $(whoami)"
|
| 12 |
echo "* Status of Admin: $(id admin 2>/dev/null || echo 'Admin user not found')"
|
| 13 |
}
|
|
|
|
| 15 |
start_ssh_service() {
|
| 16 |
if ! pgrep -x "sshd" >/dev/null; then
|
| 17 |
echo "* Starting SSH server on port 2222 *"
|
| 18 |
+
sudo /usr/sbin/sshd -p 2222 || { echo "Failed to start SSH server"; exit 1; }
|
| 19 |
#/usr/sbin/sshd -D || { echo "Failed to start SSH server"; exit 1; }
|
| 20 |
else
|
| 21 |
echo "* SSH server is already running *"
|