ubantu file permissions Permission denied

The absence of relevant file execute permissions

Solution:

The first step :( command window to enter commands)

chmod u+x *.sh

The second step :( command window to start the command again)

cd /home/homework/mysql && ./start.sh

Mysql to start normal;


Chmod Detailed
chmod: file / directory permissions command
This command is used to change the file or directory access. This command is used in two ways:

Method a: Method set comprising words and letters operator expressions 
which syntax is: chmod [who] [opt] [mode] file / directory name

who representing an object, or a combination of the following letters:

u: User, that is, the owner of the file or directory. 
g: Group, that is, their group of files or directories. 
o: Other, except for the file or directory owner, or their group, others belong to this range. 
a: All, that is, all users including owner, owning group, and other users.

opt is representative of operation, can be: 
+: Add a permission 
-: cancel a privilege 
=: given given permission, and permission to cancel the original

represents permission mode: 
R & lt: read 
w: write 
x: Executable

Example: chmod u + x * .sh


Method 2: digital setting method 
which syntax is: chmod [mode] File Name

Mode wherein the threshold is a combination of three arrays Arab, particularly on behalf of the following meanings:

Users manipulate files or directories, there are three different types: file owner, group, user, other users. MSB value represents the permissions of the file owner, the middle bit represents a group of users permission value, the lowest bit indicates other authority value of the user, so the chmod 777, three numbers above 7 correspond to three user permissions values 7.
Permissions on the file or directory is divided into three kinds: read-only, write-only, executable.

Competence Permissions value Binary Specific role
r 4 00000100 read, read. The current user can read the contents of the file, the current user can browse the directory.
w 2 00000010 write, write. The current user can add or modify the contents of the file, the current user can delete, move, or directory within the directory file.
x 1 00000001 execute, execute. The current user can execute the file, the current user can access the directory.

 

 

 

 

In accordance with the above table, it is a combination of rights authority value corresponding to the sum, as follows:

7 = 4 + 2 + 1 write permission to run
the read 4 + 1 = 5 and the permission to run
4 = 4 read-only permissions

Example: chmod 644 test.txt

Guess you like

Origin www.cnblogs.com/TJGKK/p/11411905.html