LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-02-2010, 01:44 PM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,557
Blog Entries: 28

Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
How best to run Bacula's bat?


Hello :-)

What is best practice for running Bacula's bat (Bacula Administration Tool) on Linux? Specifically on Slackware 13.0 with Xfce.

/usr/bin/bat is installed as root:root 554; its config file (typically /etc/bacula/bat.conf) is installed as root:root 640. Presumably there are good reasons for these settings.

bat is a GUI tool so needs to run under X. Running X as root is considered insecure or dangerous.

One solution would be to put an ordinary user in group bacula (say) and give that group execute permission on /usr/bin/bat and read permission on /etc/bacula/bat.conf.

Netsearching for combinations of bacula, bat, X, root has not found anything helpful (bat without bacula finds too many pages about .bat files).

Best

Charles
 
Old 03-02-2010, 01:58 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,034

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
bat is a GUI tool so needs to run under X. Running X as root is considered insecure or dangerous.
Many distros have package-manager GUIs that need to be run with root privileges. There do not seem to be any problems. The 'buntu's have synaptic (gnome) and adept (KDE) as well as the command-line apt-get, aptitude etc.

There is a difference between "Running X as root" and running an application as root, on X.
 
Old 03-02-2010, 02:12 PM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,557
Blog Entries: 28

Original Poster
Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
Quote:
Originally Posted by tredegar View Post
There is a difference between "Running X as root" and running an application as root, on X.
Thanks for the clarification; I should have written "running bat as root, on X"
 
Old 03-02-2010, 02:22 PM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,034

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
OK, But does that change your Q?

Don't forget that every time you open a terminal in your GUI, and su or sudo to root, you are, technically "Running an X application as root".

So I am thinking that you should not worry about it.

I would not startx as root, or allow a GUI login as root, but that's a different matter altogether.
 
Old 03-02-2010, 02:40 PM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,557
Blog Entries: 28

Original Poster
Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
Quote:
Originally Posted by tredegar View Post
Don't forget that every time you open a terminal in your GUI, and su or sudo to root, you are, technically "Running an X application as root".
Thanks and "point taken"

I tried it and it didn't work though:
Code:
c@CW8:~$ su root bat
Password:
/usr/bin/bat: /usr/bin/bat: cannot execute binary file
c@CW8:~$ ll /usr/bin/bat
-r-xr-xr-- 1 root bacula 13M Mar  1 19:01 /usr/bin/bat
c@CW8:~$ su - root bat
Password:
/usr/bin/bat: /usr/bin/bat: cannot execute binary file
Meanwhile, the solution using group bacula does work so I'm wondering if it has any disadvantages:
Code:
c@CW8:~$ ll /usr/bin/bat /etc/bacula/bat.conf
-rw-r----- 1 root bacula 143 Mar  1 19:01 /etc/bacula/bat.conf
-r-xr-xr-- 1 root bacula 13M Mar  1 19:01 /usr/bin/bat
c@CW8:~$ bat&
[1] 18070
[bat ran OK]
 
Old 03-02-2010, 03:17 PM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,034

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
I am not familiar with your distro or WM.

But I do not think you can
Code:
c@CW8:~$ su root bat
If your distro supports / encourages sudo then you can
Code:
sudo bat
or, is su is the supported means of becoming root, use:
Code:
su -
bat
Your solution with the group bacula, looks fine, but I do not think it is necessary.
 
1 members found this post helpful.
Old 03-02-2010, 11:41 PM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,557
Blog Entries: 28

Original Poster
Rep: Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178Reputation: 1178
Thanks tredegar

Regards su and sudo, my su root bat was never going to work. Experimenting shows only sudo does work:
Code:
c@CW8:~$ su root -c bat
Password:
No protocol specified
bat: cannot connect to X server :0.0
c@CW8:~$ su -
Password:
root@CW8:~# bat
bat: cannot connect to X server
root@CW8:~# logout
c@CW8:~$ sudo bat
Password:
[bat ran OK]
Quote:
Originally Posted by tredegar View Post
Your solution with the group bacula, looks fine, but I do not think it is necessary.
That's exactly the sort of input I was hoping for
 
  


Reply

Tags
bacula, root


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to run bat file from Unix script??? gopi_20us Programming 10 09-14-2010 10:15 AM
WinXP pro don't run "logon script = logon.bat" Bengt7jqb Linux - Server 2 04-13-2008 01:11 PM
Run BAT or EXE from WINDOWS on UNIX npati General 5 02-13-2008 05:00 PM
Does linux run bat files like DOS oldgi Linux - Software 6 07-05-2007 12:47 PM
how to run the *.bat file ztdep Linux - Software 8 07-19-2005 05:36 PM


All times are GMT -5. The time now is 05:22 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration