Software⏱️ 2 min read📅 2026-05-31

How to Fix: Running my program says "bash: ./program Permission denied"

Permission denied error when running a compiled C++ program on Ubuntu.

Quick Answer: Check the file permissions on computer 2 and ensure that the owner has execute privileges for the program.

Running a program on one computer but not another can be frustrating, especially when the issue seems to arise from permissions. This problem typically occurs because of differences in file ownership or access rights between the two systems.

💡 Why You Are Getting This Error

  • [Cause]

🔧 Proven Troubleshooting Steps

Method 1: Change Ownership

  1. Step 1: Open the terminal on computer 2 and navigate to the directory where your program is located.

Method 2: Change Permissions

  1. Step 1: Use the `chmod` command to change the permissions of your program. For example, if you want to make it executable by everyone, use `chmod +x ./program_name

🎯 Final Words

To avoid this issue in the future, ensure that your program has the correct permissions on both computers. You can also consider using a version control system to manage your files and track changes.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions