+2 votes
2.5k views
in Programming by
I was trying to execute a .sh file, permission denied was coming . I am using Ubuntu and for executing .sh file how to change permission from root? thanks for help!

1 Answer

+1 vote
by Expert (5.9k points)

Its very simple you need to become root by this command 

 

sudo - i       // to become root

 

Now cd to the file path like example below :

cd    /path/to/file path

 Now we can change permission by this command :

chmod +x filename.sh

Now you can simply run .sh file like 

./filename.sh

If you want to change the user so you can switch user like :

sudo -i -u username   // username is the user by which you are logged in.

 

In case of any query please comment.

 

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated