Here’s the command to add a Linux user.
useradd -m -s $(which bash) -G sudo ulysses |
-m creates a home directory. -s selects a shell. -G adds user to a sudo group.
cloud engineer
Here’s the command to add a Linux user.
useradd -m -s $(which bash) -G sudo ulysses |
useradd -m -s $(which bash) -G sudo ulysses
-m creates a home directory. -s selects a shell. -G adds user to a sudo group.
If you already have Google SDK installed, you can activate GCloud Interactive Shell, which is still in beta by the way, by typing the following command from the Google SDK terminal.
gcloud beta interactive |
gcloud beta interactive
The interactive shell environment has auto-completion. It shows you who’s logged in and which project you are currently set in. To exit the interactive shell, just Press F9 to quit.
Here’s how to run a shell script from your website. You’ll need 2 files.
Here’s the contents of foo.php. Wrap your output with ‘pre’ for better formatting.
<?php $output = shell_exec('/var/www/html/bar.sh 2>&1'); echo "$output"; |
<?php $output = shell_exec('/var/www/html/bar.sh 2>&1'); echo "$output";
Here’s the content of bar.sh. Output will be displayed on web page.
#!/bin/bash now="$(date +'%y%m%d')" echo $now aws s3 ls |
#!/bin/bash now="$(date +'%y%m%d')" echo $now aws s3 ls