How to allow a user to do ping?

Hi! I wonder how can I allow a non-root user to do ping?

On 01/11/2010 11:46 AM, Ansus wrote:
>
> Hi! I wonder how can I allow a non-root user to do ping?

That should be automatic. On my system, ‘ls -l /bin/ping’ shows

-rwsr-xr-x 1 root root 40016 2009-10-23 21:52 /bin/ping

Although it is owned by root, all users can execute it.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If the ‘permissions’ for the system are changed from ‘Easy’ to ‘Secure’ or
‘Paranoid’ then the SUID bit is removed and this no longer works. Either
way you are correct and to “fix” it you can add that back:

sudo chmod 4755 /bin/ping

Good luck.

Larry Finger wrote:
> On 01/11/2010 11:46 AM, Ansus wrote:
>> Hi! I wonder how can I allow a non-root user to do ping?
>
> That should be automatic. On my system, ‘ls -l /bin/ping’ shows
>
> -rwsr-xr-x 1 root root 40016 2009-10-23 21:52 /bin/ping
>
> Although it is owned by root, all users can execute it.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJLS26YAAoJEF+XTK08PnB54ugQALM+hASt0xQVyVjbAvKL2Wof
M7akctEMnjjFf51zVy7qedk3ke2wuDJ+9qxg6ALFKZ39ss0geIrWgcK6sUgO6jWt
xLyUpdSnuqKk0KGxYgun5QkiGvcd7m410WnaBgnNJK7zyrS6IgUHkUsODY/xzYxw
hW1hja8qqwH3v8AM4vihJ3/oD3F7FHmhgGRi8WmZHVtqW8Yg3wDEDPiW34eI7sb2
3Erj+wIDCQN9O+GQS7JcboKcHGSmUk5IuBkoEstNo2llQxAZTnc8wIaukPtp6mA4
28gF+6Fmq8bp8hti1SRS9N+/TqbUSGNGqt6h9Mhwl+Q+tD71J7uk6cDlRzqY2TuK
4TjuKLJprk8keRqo4x5822RyRpAlgbqtQ46iwNE+d4H709Ui64yPihQGurBzPvO5
SjQC9SC8LWou/z7WaVQvggdlMVY0XMmRLPyC4tmcghC7gILi8JpQ/9238GmR94kn
+NdLz6PgegBoO7rvoiWoNJR/LTPFG+Ty2pxQOiBjtyuKZX0apnBDlXf71tA6d1Ca
8gE6OYJ4JFva75wEf3E8hj+lnrCKHFw5jvrtZKtqOPA1oG7J5LKyd7GJtP6EJmq3
v1sibCh0+qhpFlReYYbra/+v4a00PNIzwm/68Ru002WXpsGLsfjTjs4K1VKSWXzo
G/AIQrW09rB3kVyUS7T7
=TMCO
-----END PGP SIGNATURE-----

Yes I can do ping but under Wine it works only under root. How can I change it?

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Since the executable that runs the ping command needs ‘root’ privileges
you’re possibly stuck at this point. In order to ping a program must use,
as I recall, what is known as a “raw socket” which requires root
privileges. As a result the ‘ping’ command has the SUID bet so when you
run it the permissions used are ‘root’ even though you are not ‘root’ and
do not have rights to do other root-ish things.

What does this have to do with wine? If wine runs something chances are
extremely good there is no way for it to know that it needs to run that
something as ‘root’ since the SUID functionality comes from the OS
recognizing Linux commands directly made from an application and ‘wine’
will not be making that kind of a call. You could have your users all run
‘wine’ as ‘root’ somehow, via sudo perhaps, but this is probably not
desired. In fact this all begs the question, why do you want to ping from
within wine?

Good luck.

Ansus wrote:
> Yes I can do ping but under Wine it works only under root. How can I
> change it?
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJLToc/AAoJEF+XTK08PnB5+wUP+wSisW4FnlNwK2FSUEKPQYzQ
fCfV0LoyXgJNlKIPZgXml/xt+ZQkt10xIs/j0jvLNhNMt1xqjnx2dQg19qdyZ4Wv
/icUVFtg025vvreFtsXfiBDgetzD/GB7MkqQRTCcyfyRTdzszs/+r1oLGv1KsghX
Sbux0zotCrQqAsFIHhkfCsRSmCHYDa3zmNrTFeTH2LSq2pUEezYk+XaJSQDO+Dht
jmr21Buc2g0xa16bDWdWIr3YAl+xN75tUpwPdsNzhw5FtV8Az0/GAWrTyp7pra7M
P6LuXeNDBowEpDDNXMLmlzJGqsY8VtA8h9HwKnMvQFYvNeG3WQcHK2vwcJUms5sl
VIxWF8DblZaPM4eb64mIBzTWK+WhWCjGxQXy8AVfN3tB5pqwoHMRqlSOh4YG4Jd+
aAqkDOQAabd4AkVXMUYnddxBWCGEmhD9r0SeB3WvS+P2euVfm7Lcd23faHzXue/d
2TtY8hs1tnS50vQNWA5mpwXDa8ybHB2kmAIJr3gHGvoUBzHRYTY18AlCXby1mahj
kSnUjyDEwNPYu5cEi7H8b7E4wxVGfMSow2qClsTXwrMTiw8GsWRci+CmJgN0Bf/+
0NWblM3PdbNenlN/r5dUsa92LglLELXAvwHXmOt7EUlJN9m4pwwoS9HcsBmSs+zB
L87Unk8xS6GdMT5akhws
=uBUe
-----END PGP SIGNATURE-----

Unfortunately broadcasting does not work in my neighborhood because I connect the network using PPTP. That’s why I need a network scanner to find the computers. And the good scanner is only for Windows. It pings the computers first and this feature cannot be disabled. As it pings, it reports an error message, so it is impossible to use it without root priviledges.

Under root it does not report error but does not ping either, at least it does not find any computers.

As I recall it worked well under wine in Ubuntu though…

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The “good scanner” is only for windows? Are you sure about that? nmap is
pretty stinkin’ good and it’s even in SUSE’s repositories. What are your
specific needs with your scanner? It isn’t pinging, it isn’t using wine,
it may be related to scanning, but so far we’re tracking down specific
symptoms without addressing the real problem.

Good luck.

On 02/15/2010 02:16 PM, Ansus wrote:
>
> Unfortunately broadcasting does not work in my neighborhood because I
> connect the network using PPTP. That’s why I need a network scanner to
> find the computers. And the good scanner is only for Windows. It pings
> the computers first and this feature cannot be disabled. As it pings, it
> reports an error message, so it is impossible to use it without root
> priviledges.
>
> Under root it does not report error but does not ping either, at least
> it does not find any computers.
>
> As I recall it worked well under wine in Ubuntu though…
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.12 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJLeb73AAoJEF+XTK08PnB5oogP/0F560Bmzbc0OKeeAMA/zyOE
+l5tOqTEcgIRFQ1fLAWHY+Sdczd2kU4fZuzU9v7mB6/ncpPdmEr3R2lSk7uI0TvX
xe6kIk97CkvflOs0BvyUP6S4H87sKnk0eY0X0sgRfRdpsBS0DszMBAjjmpS/3q47
g9cCRqIjnZeSM3Rilj8Rz33zcVHtG70zLFsrHzCnzIK2D/FmZmsnhUmhACpRmuwl
w5iHhnF69QrqKTDeEUIuhg1KNhaGyzwhx8Mii57iCO9awtsqjEI/FmvxOuKB0NN4
61epaR8ZJ6l4qMULVVDJZD0n0PjuOXaYgSpPdbk6vKUP5ClD2KPUZ20Gwtnd/OXA
wbtkdUieZVMj4JUhe4Uq+02s80VsQpHRTD1nd1yK9hczSz+4EA7QB8sSCDtpv0ve
ZLl63t0cy8Vrm/aIW7VKVQJtbuf/uuVhqQ2V29mVhbd1fu4tqCguRyJF3xhFaSbU
HQZ3s7eaV3YHWFR/CJNXXrpxPgKZZVpqYBPOQ92I6BoZz+iBSEjB5V5kxHY62Mwe
YOqHq2EqEcGHRmcj2UwnLuAgjdTbrFpaYRwm/MyIQnlJdC5uYm3q2ulsIJgs3U9B
geD3OhOEpIcEkTYLwMkTZxfMEuiubDXQ2eyDkNCtuATOsZXXJZ4MTF0TGTJH4M0u
D/g+MpuWViO5G2tdwoee
=5/7X
-----END PGP SIGNATURE-----