chmod

Android: how can execute a chmod on rooted devides

南楼画角 提交于 2019-11-30 19:52:36
问题 I would execute a command on my rooted Android 2.1 device String path = "/data/data/com.android.providers.settings/databases/settings.db"; Runtime.getRuntime().exec("/system/bin/chmod -f 777 " + path); But this command does nothing on the targeted file. Any idea? 回答1: You need to get the runtime as the root user first. There is a nice ShellInterface class that you can use from the MarketEnabler source available on Google Code. Though keep in mind this source code is released under the GPL.

linux就该这么学-第七节课

China☆狼群 提交于 2019-11-30 19:05:02
#文件权限很重要,有些时候删除和新建文件没有权限根本操作不了,linux一切皆是文件,所以必须得了解下权限了。 文件的一般权限 简单的ls -ld 命令就能看到权限,dr-xr-x---补全应该是drwxrwxrwx,对应的分别为 r(read)可读权限 w(write)可写权限 x(excute)可执行权限 d(directory)目录文件。 依次对应文件所有者,文件所有组,其他用户。 当给予某个文件最高权限时,可使用-rwxrwxrwx,即可读可写可执行,chmod 777加上文件名称即可。排除为特殊权限外。 文件的特殊权限 SUID 可以让二进制程序的执行者临时拥有属组的权限。命令为chmod u+s 文件名 SGID 可以让二进制程序的执行者临时拥有属组的权限,自动继承用户组。命令为chmod -R g+s 文件名 SBIT 保护文件,使用户只能删除自己的文件。 命令为chmod -R o+t 文件名 rwx -> rws rw- -> rwS 大小写的变化。 rw- -> rwT rwx ->rwt SUID权限为4 SGID权限为2 SBIT权限为1 文件的隐藏属性 chattr 用于设置文件的隐藏权限,如果需要想要把某个隐藏的功能添加到文件上,则需要在命令后追加 “+参数” ,如果想要把某个隐藏功能移出文件,则需要追加 “-参数” 。 chattr

Linux命令总结

﹥>﹥吖頭↗ 提交于 2019-11-30 18:45:06
1、 whereis 查找命令的帮助、源代码 -b 二进制 2、locate find files by name 只能查updatedb库里内容,locate从/var/lib/mlocate.db 查找路径。 3、groupadd 添加组 groupadd test 4、usermod 更改用户属性 5、chmod 设置文件权限 6、chown 更改及设置用户和组 7、id 查看用户身份 8、umask 控制文件默认权限 9、userdel 删除用户 来源: https://www.cnblogs.com/dongxu2019/p/11635353.html

Why do my setuid root bash shell scripts not work?

非 Y 不嫁゛ 提交于 2019-11-30 17:27:59
问题 I created this simple script to allow the user to remove files created by the web server in his home directory without giving him "su". Both scripts are set with "chmod 4750". The craziest thing is that they DID work and now they don't. Here's the scripts: #!/bin/bash # Ask for directory to delete echo "Enter the file or directory you would like to delete, the assumed path is /home/user" read DIRECTORY rm -rf /home/user/"$DIRECTORY" echo "Deleting /home/user/$DIRECTORY ..." exit 0 2: #!/bin

Differences between CHMOD 755 vs 750 permissions set

試著忘記壹切 提交于 2019-11-30 16:50:18
I have some files with 755 and i need to change them to 750, but i am not sure if this can affect some process. I am changin JARs, XMLs, LOGs and properitees files. Can someone explain to me the difference between these two permission set? Thanks! Jim Garrison 0755 = User: rwx Group: r-x World: r-x 0750 = User: rwx Group: r-x World: --- (i.e. World: no access) r = read w = write x = execute (traverse for directories) 来源: https://stackoverflow.com/questions/19547085/differences-between-chmod-755-vs-750-permissions-set

Linux系统文件权限

感情迁移 提交于 2019-11-30 14:58:53
1、改变权限属性命令 chmod:   chmod 是用来改变文件或目录权限的命令,但只有文件的属主和超级用户 root 才有这种权限。通过 chmod 来改变文件或目录的权限有两种方法:一种是用过 权限字母和操作符表达式 的方法来设置权限;另一种是使用 数字方法 来设置权限。 2、chmod 数字权限方法:   使用数字权限设置权限的命令格式如下:   chmod [数字组合] 文件名   r  4   w  2   x  1   -   0   3、修改权限   -R  递归   目录的权限默认是 755,文件的权限默认是 644,将文件的权限修改为和目录一样的权限。    4、chmod 字符式权限表示法:   chmod [用户类型] [+|-|=] [权限字符] 文件名      例1:对文件进行加减权限      u 代表用户,即属主;只对用户部分进行权限的更改。   例2:只给用户组执行权限;使用 = 进行操作。      例3:将所有用户的执行权限减掉。      ugo 表示所有用户,a 表示所有用户      例4:前面不接用户只是用 + 或 - 接权限,所有用户的权限都发生改变。    5、改变文件所属关系(属主)chown   chown 当我们改变一个文件的属组,我们所使用得用户必须是该文件的属主而且同时是目标属组成员,或超级用户

Linux文件基本属性

北城以北 提交于 2019-11-30 12:52:39
Linux 文件基本属性 Linux系统是一种典型的多用户系统,不同的用户处于不同的地位,拥有不同的权限。为了保护系统的安全性,Linux系统对不同的用户访问同一文件(包括目录文件)的权限做了不同的规定。 在Linux中我们可以使用ll或者ls –l命令来显示一个文件的属性以及文件所属的用户和组,如: [root@www /]# ls -l total 64 dr-xr-xr-x 2 root root 4096 Dec 14 2012 bin dr-xr-xr-x 4 root root 4096 Apr 19 2012 boot …… 实例中,bin文件的第一个属性用"d"表示。"d"在Linux中代表该文件是一个目录文件。 在Linux中第一个字符代表这个文件是目录、文件或链接文件等等。 当为[ d ]则是目录 当为[ - ]则是文件; 若是[ l ]则表示为链接文档(link file); 若是[ b ]则表示为装置文件里面的可供储存的接口设备(可随机存取装置); 若是[ c ]则表示为装置文件里面的串行端口设备,例如键盘、鼠标(一次性读取装置)。 接下来的字符中,以三个为一组,且均为『rwx』 的三个参数的组合。其中,[ r ]代表可读(read)、[ w ]代表可写(write)、[ x ]代表可执行(execute)。 要注意的是,这三个权限的位置不会改变

Linux权限基础

自作多情 提交于 2019-11-30 11:28:41
Linux权限基础 四种权限大类 基本权限 特殊权限 隐藏权限 file ACL权限 三种基本权限 r(read) 读是基本权限,没有读权限其他的一切操作都会被限制 读 4 w(write) 写 2 x(exceute) 执行 1 文件权限案例 dr-xr-xr-x. 5 root root 4096 9月 19 17:37 boot 数字表示权限-555 文件的权限一共有9个字符,3个为一对 第一对 r-x 文件所有者对此文件所拥有的权限 读 执行 第二对 r-x 文件所属组对此文件所拥有的权限 读 执行 第三对 r-x 其他用户对此文件拥有的权限 读 执行 基本权限命令 chmod 改变文件的访问权限 命令语法 chmod [options] mode file... 命令选项 -R 递归设置权限,针对目录有效 mode 谁给什么权限 u(所有者) g(所属组) o(其他人) a(所有人) + - = chmod u=rwx a chmode a+rw b 权限 r 读 w 写 x 执行 数字权限 r 读 4 w 写 2 x 执行 1 一般使用这个数字权限简单方便 chmod 760 abc chown 修改文件或文件夹所有者和组 命令语法 chown [options] user [:group] file... 命令选项 -R 递归设置,针对文件夹 chown 新所有者

How to chmod 0007 a lot of directories with php? [duplicate]

。_饼干妹妹 提交于 2019-11-30 09:50:14
问题 This question already has answers here : PHP mkdir: Permission denied problem (12 answers) Closed last year . My Website will contain thousands of subdirectories named 'e' which are to hold user created .json files specific to that directory's submission form. I need this newly created directory to be chmod 0007. How can I do this? This code below comes from a php file the global store function for local storage in folder 'e' but it only works right now if that folder is already there and

Git ignoring gitconfig?

Deadly 提交于 2019-11-30 08:25:02
问题 It appears Git is ignoring ~/.gitconfig $ git config --global core.filemode false $ git config -l core.filemode=false core.filemode=true So now there are 2 entries for core.filemode and git is still not ignoring filemode changes $ touch modetest $ git add . $ git commit -m test1 [master (root-commit) 320cfe4] test1 0 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 modetest $ chmod +x modetest $ git diff diff --git a/modetest b/modetest old mode 100644 new mode 100755 Based