+2 votes
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 


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
710 Folks are online
55 members and 655 guest online

Your feedback is highly appreciated