1

I am using NetBeans 8.0.1 on windows and compiling/running/debugging on a remote host on a debian PC on the LAN. I have set up the NetBeans host as root. I also have it set up to debug using gdb. My C code includes the alsa libraries and attempts to call snd_pcm_open and get a handle.

The problem is that when I debug the executable from NetBeans, I get this error message which basically means a permission issue I believe:

ALSA lib pcm_dsnoop.c:618:(snd_pcm_dsnoop_open) unable to open slave.

Test results:

  1. Local machine terminal as root runs correctly.
  2. Local machine terminal as non root user runs correctly.
  3. Remote SSH as non root user runs correctly.
  4. Remote SSH as root gives error message.

I have tried adding root to the audio group, which doesn’t help.

So the basic questions are:

  1. Should this be approached as an environment or shell setup issue? If so, what should I look for?
  2. Is there a best practice for remote host setup? Should this be a non root user set up some way to allow compiling and gdb, etc?

1 Answer 1

0
  1. Remote SSH as root gives error message.

First guess is that the remote host does not allow root login via ssh. Look at the file /etc/ssh/sshd_config for the PermitRootLogin directive then at the sshd_config man page for the possible options. Alternatively, look at /var/log/auth.log on the remote host, assuming you have permissions to do so there. You should see a clue as to the reason, assuming it's simply an inability to log in as root.

If you can log in as root, then hopefully someone else has an answer.

I have tried adding root to the audio group, which doesn’t help.

If you can't login, then group membership is irrelevant.

Is there a best practice for remote host setup? Should this be a non root user set up some way to allow compiling and gdb, etc?

First, allowing remote root logins (via ssh or any service) is bad practice.
Second, it's always (IMO) best if you can run as much as possible in userspace.

1
  • I can log in as root, so thats not the issue. At present I moved forward with userspace, and all works as needed, including gdb. Sep 11, 2015 at 15:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .