Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the man page for FreeBSD ping:

 -s packetsize
         Specify the number of data bytes to be sent.  The default is 56,
         which translates into 64 ICMP data bytes when combined with the 8
         bytes of ICMP header data.  Only the super-user may specify val-
         ues more than default.  This option cannot be used with ping

Does anyone know how I can let non-superusers send pings larger then 56? Can I increase the default size, or somehow allow -s to be used by non-root users? I am aware of the security implications, that this could allow users to start a ping flood, so if I can restrict this to allowing only a single (shell-less) user, all the better.

share|improve this question
up vote 2 down vote accepted

Consider using sudo, EX:

coryj  ALL = NOPASSWD: /bin/ping

This should let user coryj run /bin/ping (caveat: using any args he likes, not just -s) without a password.

Note the security implications of this; see man pages for sudo(8) and sudoers(5).

share|improve this answer
Accepted this, seems a little cleaner then modifying the source, though modifying the source affords a little more granular control. Both good solutions. Personally I've been convinced to rethink my original reasons for doing this and accomplish my goals a different way. – Cory J Jul 27 '10 at 19:27

You can modify the source code and change the behavior. You can make the default size bigger, it's on line 98 of ping.c in /usr/src/sbin/ping/. Or you can disable this feature on line 446 by replacing the line with if (0) {. After you change it, run make install.

I have to wonder why you would need a normal user to send a large ICMP message.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.