突然发现这个问题,不知道问题出在哪里。
ls -l /usr/local/bin |grep ping
lrwxr-xr-x 1 pcpc admin 31 8 31 08:46 nping -> ../Cellar/nmap/7.80_1/bin/nping
-rwsr-xr-x 1 pcpc admin 41968 9 16 11:25 ping
lrwxr-xr-x 1 pcpc admin 33 11 18 2018 tcping -> ../Cellar/tcping/1.3.5/bin/tcping
MacBOOK:bin pcpc$ which ping
/usr/local/opt/inetutils/libexec/gnubin/ping
MacBOOK:/ pcpc$ ping baidu.com
ping: Lacking privilege for raw socket.
MacBOOK:/ pcpc$ traceroute 223.5.5.5
traceroute to 223.5.5.5 (223.5.5.5), 64 hops max
traceroute: socket: Operation not permitted
MacBOOK:sbin pcpc$ groups
staff everyone localaccounts _appserverusr admin _appserveradm _lpadmin com.apple.sharepoint.group.3 com.apple.sharepoint.group.2 _appstore _lpoperator _developer _analyticsusers com.apple.access_ftp com.apple.access_screensharing com.apple.access_ssh com.apple.sharepoint.group.1
vi ~/.bash_profile
export CLICOLOR=1
export PYENV_ROOT="${HOME}/.pyenv"
if [ -d "${PYENV_ROOT}" ]; then
export PATH="${PYENV_ROOT}/bin:${PATH}"
eval "$(pyenv init -)"
#eval "$(thefuck --alias fuck)"
fi
archey
#if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi
export PATH="/usr/local/opt/sqlite/bin:$PATH"
export PATH="/usr/local/opt/inetutils/libexec/gnubin:$PATH"
export PATH=$PATH:/usr/local/sbin
export LDFLAGS="-L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include"
export PATH="/usr/local/opt/icu4c/bin:$PATH"
export PATH="/usr/local/opt/icu4c/sbin:$PATH"
#export PATH="$HOME/.rbenv/bin:$PATH"
#eval "$(rbenv init -)"
export PATH="/usr/local/opt/sqlite/bin:$PATH"
export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export PATH="/usr/local/opt/nss/bin:$PATH"
if which pyenv-virtualenv-init > /dev/null; then eval "$(pyenv virtualenv-init -)"; fi
我能想到的信息就这些了,还需要什么么???
1
ysc3839 2019-09-16 12:32:32 +08:00 via Android
ping: Lacking privilege for raw socket.
ping 已经告诉你问题出在哪了。 |
2
pupboss 2019-09-16 12:49:15 +08:00 via iPhone
inetutils 那行干掉就好了
|
4
PbCopy111 OP 我知道了,因为我需要 ftp 工具,所以通过 brew 安装了工具包:
`brew install inetutils` 安装以后需要设置 path,所以才有了`export PATH="/usr/local/opt/inetutils/libexec/gnubin:$PATH"`这行。 可惜这样会导致 ping 之类的命令都无权限。 所以应该在 install 以后继续运行`brew link --overwrite inetutils`,这样才可以正常使用 ftp 之类的命令。 |