1

I want to install BRO-IDS.

I ran the following commands:

cd bro-2.2
./configure --prefix=/nsm/bro
make
make install

When I run this command:

export PATH=/nsm/bro/bin:$PATH

It doesn't work. Is it correct? How do I run this command?

You can also add PATH=/opt/bro2/bin:$PATH to your ~/.profile file in your home directory to make the change permanent.

I get this error when I try that:

root@ubuntu:/home/eng-it/bro-2.2# ~/.profile
bash: /root/.profile: Permission denied

and this:

root@ubuntu:/home/eng-it/bro-2.2# sudo su -c "echo 'PATH=/opt/bro2/bin:$PATH'>>/etc/profile

Doesn't work. Is it correct?

1
  • 1
    What does "Do not be operational" mean? Do you mean that it doesn't work?
    – Zanna
    Aug 28, 2016 at 9:15

1 Answer 1

2

Your first command export PATH=/nsm/bro/bin:$PATH is valid in theory, although it's not recommended to prepend to the path - you should append (add to the end) instead.

Have you checked that /nsm/bro/bin exists and contains the files you want to run?

Also, the command would only affect the current shell session; the PATH will be unaffected in any other shell (so when you open a new terminal the PATH will not include your addition).

root@ubuntu:/home/eng-it/bro-2.2# ~/.profile
bash: /root/.profile: Permission denied

This occurs because you are trying to run a file /root/.profile which either does not exist or has no execute permission.

If you are root, then the path ~/.profile doesn't lead to your .profile, because ~ expansion is done in reference to the current user. Switch to your normal user and then do

nano ~/.profile

And then add the lines you want, save and exit.

This command seems valid (although not advisable)

root@ubuntu:/home/eng-it/bro-2.2# sudo su -c "echo 'PATH=/opt/bro2/bin:$PATH'>>/etc/profile"

sudo su -c is redundant since you are already root (why are you root? You should avoid this unless absolutely necessary). However, since you installed the program at /nsm/bro according to your ./configure prefix flag, I don't see why adding /opt/bro2/bin to the PATH would help.

Even if that path is correct, you need to log out and log back in for changes made in .profile or /etc/profile to take effect. To source them instantly, you can start a login shell by typing bash -l, or you can source the file you edited source /etc/profile

However, it is not recommended to add things to /etc/profile - you should make a file in /etc/profile.d, or specify the variable locally for your user in ~/.profile.

Assuming the files you want to run are actually in /nsm/bro/bin, as a normal user (NOT root) You could do

echo 'PATH=$PATH:/nsm/bro/bin' >> ~/.profile

or if you really want to set it globally

sudo bash -c 'echo 'PATH=$PATH:/nsm/bro/bin' > /etc/profile.d/path.sh'

and then log out and log back in.

You must log in to answer this question.

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