VMware Cloud Community
CSummers
Contributor
Contributor
Jump to solution

Permission Denied when running scripts

This is probably a simple answer.

I have 2 ESX servers and I'm trying to run a pl file to install the latest 3.0.1 patches. I did a mkdir /var/updates and used WinSCP to copy the tar files. I created a ESXUpdate.pl file based off of some instructions from another forum post. The problem I'm having is when I type ./ESXPatches.pl I'm getting "-bash: ./ESXPatches.pl: Permission denied"

I've tried this through Putty directly on the console. I've seen this happen on another pl file to open ports on the firewall. What am I doing wrong?

0 Kudos
1 Solution

Accepted Solutions
vmmeup
Expert
Expert
Jump to solution

Do an ls -la and check to see if there is an x like below

-rwxrr the first grouping is for the user i.e. -\{rwx} = Read Write and Execute for the user that owns the file. The second grouping is "Group" and the final grouping is world. A "-" means that that grouping doesn't have that permssion. If it doesn't have the "x" do a chmod u+x to give just the user execute permissions.

Sid Smith ----- VCP, VTSP, CCNA, CCA(Xen Server), MCTS Hyper-V & SCVMM08 [http://www.dailyhypervisor.com] - Don't forget to award points for correct and helpful answers. 😉

View solution in original post

6 Replies
sbeaver
Leadership
Leadership
Jump to solution

WHich account are you trying to run this from? Root? If it is root how did you login in to be root?

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
0 Kudos
vmmeup
Expert
Expert
Jump to solution

Login as root... su - to root or use sudo

Sid Smith ----- VCP, VTSP, CCNA, CCA(Xen Server), MCTS Hyper-V & SCVMM08 [http://www.dailyhypervisor.com] - Don't forget to award points for correct and helpful answers. 😉
0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

Did you check and make sure execute permission were present on that file?

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
CSummers
Contributor
Contributor
Jump to solution

I can't believe I forgot to mention I'm logging in as root.

I have no idea if it has execute permissions. How do I check, how do I fix it, and what should I do in the future to make sure this doesn't happen?

0 Kudos
sbeaver
Leadership
Leadership
Jump to solution

The simplest is to connect with WinSCP and check the properties of the file

Steve Beaver
VMware Communities User Moderator
VMware vExpert 2009 - 2020
VMware NSX vExpert - 2019 - 2020
====
Co-Author of "VMware ESX Essentials in the Virtual Data Center"
(ISBN:1420070274) from Auerbach
Come check out my blog: [www.virtualizationpractice.com/blog|http://www.virtualizationpractice.com/blog/]
Come follow me on twitter http://www.twitter.com/sbeaver

**The Cloud is a journey, not a project.**
vmmeup
Expert
Expert
Jump to solution

Do an ls -la and check to see if there is an x like below

-rwxrr the first grouping is for the user i.e. -\{rwx} = Read Write and Execute for the user that owns the file. The second grouping is "Group" and the final grouping is world. A "-" means that that grouping doesn't have that permssion. If it doesn't have the "x" do a chmod u+x to give just the user execute permissions.

Sid Smith ----- VCP, VTSP, CCNA, CCA(Xen Server), MCTS Hyper-V & SCVMM08 [http://www.dailyhypervisor.com] - Don't forget to award points for correct and helpful answers. 😉