Bash: insufficient permissions and insufficient bash Permissions
This problem occurs today when a file is opened on a terminal under ubuntu. Suddenly, the file is read-only, so you need to open its user permissions.
The specific implementation is as follows: chmod 777/home/example/filename. In this way, all permissions of this file are opened and can be accessed as much as possible. The details of chmod are as follows:
Change the permissions of a file or directory. In the UNIX system family, the control of file or directory permissions is divided by reading, writing, and executing three general permissions, and three special permissions are available, then, combine the owner with the management permission range of the group. You can use the chmod command to change the permissions of files and directories. The permission of the symbolic connection cannot be changed. If you modify the permission of the symbolic connection, the permission change will be applied to the connected original file. The permission range is expressed as follows: u: User, that is, the owner of a file or directory. G: Group, that is, the Group to which the file or directory belongs. O: Other. All Users except the file or directory owner or group belong to this range. A: All, that is, All users, including owners, groups, and other users. For details about the permission code, go to r: Read Permission. The number is "4 ". W: Write Permission. The number is "2 ". X: execute or switch the permission. The number is "1 ". -: You do not have any permission. The digit code is "0 ". S: when an object is executed, set the setuid or setgid permission for the object based on the user type specified by the who parameter.
Syntax chmod [-cfRv] [-- help] [-- version] [<permission range> +/-/= <permission settings...>] [file or directory...] chmod [-cfRv] [-- help] [-- version] [digit code] [file or directory...] chmod [-cfRv] [-- help] [-- reference = <reference file or directory>] [-- version] [file or directory...] option description-c or -- changes is similar to the "-v" parameter, but only the changed part is returned. -F or -- quiet or -- silent Do Not Display error messages. -R or -- recursive processing: all files and subdirectories under the specified directory are processed together. -V or -- verbose displays the command execution process. -- Help Online help. -- Reference = <reference file or directory> sets all permissions for the specified file or directory to the same as those for the reference file or directory -- version displays version information. <Permission range> + <permission settings> enable this permission setting for files or directories in the permission range. <Permission range>-<permission settings> disable this permission setting for files or directories in the permission range. <Permission range> = <permission settings> specify the permission range for this permission setting for files or directories. Example
Example 1: Set the file file1.txt to all users for reading: chmod ugo + r file1.txt set the file file1.txt to all users for reading: chmod a + r file1.txt sets the archive file1.txt and file2.txt as the owner of the archive, which can be written to the same group to which the archive belongs, but cannot be written to other people: chmod ug + w, o-w file1.txt file2.txt set ex1. only the owner of this file can execute: chmod u + x ex1 to set all files and subdirectories in the current directory to readable by anyone: chmod-R a + r * when another user executes the oracle sqlplus program, his identity is changed to oraclechmod u + s sqlplus because of this program temporarily, chmod can also Use numbers to indicate permissions. For example, the chmod 777 file Syntax is: chmod abc file, where a, B, and c each have a number, indicating Use R, Group, and Other permissions. R = 4, w = 2, x = 1 if you want the rwx attribute, 4 + 2 + 1 = 7; if you want the rw-attribute, 4 + 2 = 6; if you want the r-x attribute, 4 + 1 = 5.
Example 2: Chmod a = rwx file and chmod 777 file have the same effect. chmod ug = rwx, o = x file and chmod 771 file have the same effect. If chmod 4755 filename is used, the program has the root permission.
Example 3: If chmod 777 is executed after cd/media/amasun/java/develop/array. /Is to set the local directory (I .e./media/amasun/java/develop/array) to anyone's readable, write, and execute if it is an administrator or a common ROOT user, basically, you have the right to view all files.
Why do you say you are not authorized to run bash?
In Linux, when you need to execute your own script, you need to add the execution permission:
Chmod + x./morning
Or add all permissions:
Chmod + 777./morning
Run again.
Why prompt bash: extxt: insufficient Permissions
The current user group cannot obtain the permission to open/read/write the ex.txt file.
Try to add sudo before the command, or directly use the su command to switch to the root permission for execution.