但是默认配置,不应该会限制sudo后不能监听端口
happy@happy:~/demo$ g++ 1.cpp
happy@happy:~/demo$ ./a.out
正在监听端口 8090...
^C
happy@happy:~/demo$ sudo ./a.out
请输入密码:
验证成功
绑定失败
happy@happy:~/demo$ sudo gdb ./a.out
GNU gdb (Uos 8.2.1.1-1+security) 8.2.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <
http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "aarch64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<
http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<
http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./a.out...(no debugging symbols found)...done.
(gdb) run
Starting program: /home/happy/demo/a.out
正在监听端口 8090...
^C
Program received signal SIGINT, Interrupt.
0x0000007fbf3a3740 in __libc_accept (fd=3, addr=..., len=0x7fffffe084) at ../sysdeps/unix/sysv/linux/accept.c:26
26../sysdeps/unix/sysv/linux/accept.c: 没有那个文件或目录.
(gdb) quit
A debugging session is active.
Inferior 1 [process 21828] will be killed.
Quit anyway? (y or n) y
happy@happy:~/demo$ sudo -i
root@happy:~# pwd
/root
root@happy:~# /home/happy/demo/a.out
正在监听端口 8090...
【 在 Bernstein 的大作中提到: 】
: 不同系统sudo之后权限的配置有一定不同
:
--
修改:z16166 FROM 123.118.191.*
FROM 123.118.191.*