openssh server: rejected send message

When I tried to restart the ssh server on my ubuntu box, I got

me@me-one:~$ service ssh restart
restart: Rejected send message, 1 matched rules; type="method_call", sender=":1.63" (uid=1000 pid=3354 comm="restart ssh ") interface="com.ubuntu.Upstart0_6.Job" member="Restart" error name="(unset)" requested_reply="0" destination="com.ubuntu.Upstart" (uid=0 pid=1 comm="/sbin/init")

I realized that I hadn't sudo-ed

me@me-one:~$ sudo service ssh restart
ssh start/running, process 3386

Why didn't the first attempt throw an error like Permission denied or something similar. Am I overriding the error when running as root and implicitly ignoring the warning/error? Or is it just bad programming by the openssh developers?


Solution 1:

One person's "bad programming" may be another person's "it's working as intended".

It's true that you need root priveleges to restart, start, stop etc and you are getting this message because you don't have those privileges. But I agree that it would be nice if the message you got when you tried to do so without root privileges was more helpful.

You may want to check if bugs already exist in launchpad about this (presumably under upstart) and if not, report it. It's the sort of thing, though, where I'd be fairly sure you wouldn't be the first person to notice it since it's so common. Either way, bug research can be rewarding.