Day 04: Script Execution Permissions

Question:

In a bid to automate backup processes, the xFusionCorp Industries sysadmin team has developed a new bash script named xfusioncorp.sh. While the script has been distributed to all necessary servers, it lacks executable permissions on App Server 2 within the Stratos Datacenter.

Your task is to grant executable permissions to the /tmp/xfusioncorp.sh script on App Server 2. Additionally, ensure that all users have the capability to execute it.


Solution:

# SSH to App server 2
ssh steve@stapp02

# List file with permissions
ls -l /tmp/xfusioncorp.sh
---------- 1 root root 40 Oct 28 09:33 /tmp/xfusioncorp.sh

# Add permission as user=rwx; group=rx; other=rx
sudo chmod 755 /tmp/xfusioncorp.sh

# List file with permissions
ls -l /tmp/xfusioncorp.sh
-rwxr-xr-x 1 root root 40 Oct 28 09:43 /tmp/xfusioncorp.sh

# Execute script
/tmp/xfusioncorp.sh 
Welcome To KodeKloud

By shafdo

Leave a Reply

Your email address will not be published. Required fields are marked *