我最近找到了一种使用dropbear SSH服务器在我的Android设备上维护root访问权限的方法,我使用init.d修改了以root身份运行的root服务器,这是一个lil脚本魔术&我做的一些配置脚本.如果你想要,你可以查看here …无论如何,我从系统中删除了su二进制文件和Superuser.apk.我已经设法将它们复制回系统,但我不知道如何为su二进制文件设置适当的权限.如果我在另一个root手机上查看超级用户应用程序并进行更新,则会显示-rwsr -sr-x作为二进制文件的权限.如何手动设置这些相同的权限&他们的意思是什么?特别是s部分.
解决方法:
s部分是setuid位. Wikipedia:
setuid and setgid (short for “set user ID upon execution” and “set
group ID upon execution”, respectively) are Unix access rights flags
that allow users to run an executable with the permissions of the
executable’s owner or group respectively and to change behaviour in
directories.
该权限字符串表示:
>所有者可以读取,写入和执行
>文件组中的用户可以读取和执行
>其他用户可以阅读和执行
>该文件已设置setuid
您可以通过运行chmod 06755 / system / bin / su来设置该特定权限.这是八进制(=“八分之一”,像十进制是“十分之一”,十六进制是“十六分之一”)编码:
> setuid位(4)和setgid位(2)= 6
>所有者的所有权限(7)
>读取和执行组(5)
>为他人阅读和执行(5)
标签:bash,android,shell,chmod,file-permissions
来源: https://codeday.me/bug/20190624/1281723.html