为了账号安全,请及时绑定邮箱和手机立即绑定

为何 su 程序一定要放到 /system/bin 目录下?

为何 su 程序一定要放到 /system/bin 目录下?

白猪掌柜的 2019-04-06 08:31:43
各位好,请教个问题。是否su程序不放到/system/bin目录下就没效了?我是这样做的,用ro.kernel.qemu=1获得adb的root权限,adbshellid是0.0,这个时候扔个busybox和su程序到新目录/data/tmpsos的目录下,文件夹赋权777,busybox和su赋权4777,然后用adbshell"/data/tmpsos/su-c\"/data/tmpsos/busyboxmount-r/dev/block/mmcblk0p2/data/tmpsos/aso\"",命令执行成功,但是我把adb改回正常模式,再执行这条指令,就提示没权限了。是不是su程序一定要放到/system/bin目录呢?-------------补充说明机器的mount情况如下,没发现noexec限制。rootfs/rootfsro,relatime00tmpfs/devtmpfsrw,nosuid,relatime,mode=75500devpts/dev/ptsdevptsrw,relatime,mode=60000proc/procprocrw,relatime00sysfs/syssysfsrw,relatime00none/acctcgrouprw,relatime,cpuacct00tmpfs/mnt/asectmpfsrw,relatime,mode=755,gid=100000tmpfs/mnt/obbtmpfsrw,relatime,mode=755,gid=100000none/dev/cpuctlcgrouprw,relatime,cpu00/dev/block/mmcblk0p2/systemext4ro,relatime,barrier=1,data=ordered00/dev/block/mmcblk0p3/dataext4rw,nosuid,nodev,noatime,barrier=1,data=ordered,noauto_da_alloc00/dev/block/mmcblk0p4/data/cacheext4rw,nosuid,nodev,noatime,barrier=1,data=ordered00/dev/block/mmcblk0p5/data/calibrationext4rw,nosuid,nodev,noatime,barrier=1,data=ordered00/dev/block/vold/179:1/mnt/sdcardvfatrw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/vold/179:1/mnt/secure/asecvfatrw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00tmpfs/mnt/sdcard/.android_securetmpfsro,relatime,size=0k,mode=00000/dev/block/dm-0/mnt/asec/com.camigomedia.mewantbamboo-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-1/mnt/asec/com.intsig.camdict-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-2/mnt/asec/com.imangi.templerun-2vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-3/mnt/asec/com.omesoft.hypnotherapist-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-4/mnt/asec/com.halfbrick.fruitninjafree-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-5/mnt/asec/com.mybo.ponon-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-6/mnt/asec/com.outfit7.talkingtompro-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-7/mnt/asec/cn.dxy.medicinehelper-2vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-8/mnt/asec/com.KelliNoda.Battleheart-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-9/mnt/asec/com.fluik.OfficeJerkFree-2vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-10/mnt/asec/com.UCMobile-2vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-11/mnt/asec/com.forthblue.pool-2vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-12/mnt/asec/com.wochacha-2vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-13/mnt/asec/pl.idreams.CanKnockdown2-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-14/mnt/asec/com.fingersoft.cartooncamera-2vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-15/mnt/asec/com.disney.WMW-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-16/mnt/asec/com.angrymobgames.muffinknightfree-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-17/mnt/asec/com.gau.go.launcherex.gowidget.switchwidget-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-18/mnt/asec/com.jiasoft.highrail-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-19/mnt/asec/hotcard.net-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-20/mnt/asec/com.dedalord.runningfred-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-21/mnt/asec/org.cocos2dx.FishGame-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-22/mnt/asec/com.tencent.mtt-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-23/mnt/asec/com.feelingtouch.NinjaRun-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-24/mnt/asec/com.iiseeuu.zhaoyaojing-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-25/mnt/asec/info.rguide.gzmtr-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-26/mnt/asec/com.gau.go.launcherex.gowidget.clockwidget-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-27/mnt/asec/com.gau.go.launcherex.gowidget.notewidget-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-28/mnt/asec/com.mt.mtxx.mtxx-2vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-29/mnt/asec/com.outfit7.talkingtom2free-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-30/mnt/asec/com.jb.gosms-2vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-31/mnt/asec/com.likeapp.game.bubbleshooter-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-32/mnt/asec/com.mobilicos.howtomakeorigami-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00/dev/block/dm-33/mnt/asec/com.omesoft.firstaid-1vfatro,dirsync,nosuid,nodev,relatime,uid=1000,fmask=0222,dmask=0222,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro00
查看完整描述

2 回答

?
潇潇雨雨

TA贡献1833条经验 获得超4个赞

/dev/block/mmcblk0p3/dataext4rw,nosuid,nodev,noatime,barrier=1,data=ordered,noauto_da_alloc00这里/data/tmpsos/su所在的/data分区是设置了nosuid的了。
su必须设置suid才可以正常使用
                            
查看完整回答
反对 回复 2019-04-06
?
牛魔王的故事

TA贡献1830条经验 获得超3个赞

你要同時看看mountpoint的掛點是否有noexec的授權限制/dev/block/mmcblk0p2/systemext4ro,relatime,barrier=1,data=ordered00
/dev/block/mmcblk0p3/dataext4rw,nosuid,nodev,noatime,barrier=1,data=ordered,noauto_da_alloc00/system為只讀你改不了,datanosuid不能suid,所是你還是不能用,但你假設的su一定要在/system是不對的
                            
查看完整回答
反对 回复 2019-04-06
  • 2 回答
  • 0 关注
  • 255 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信