LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 12:44 PM   #1
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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, 12:58 PM   #2
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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, 01:12 PM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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, 01:22 PM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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, 01:40 PM   #5
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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, 02:17 PM   #6
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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, 10:41 PM   #7
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578

Original Poster
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
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



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 09:15 AM
WinXP pro don't run "logon script = logon.bat" Bengt7jqb Linux - Server 2 04-13-2008 12:11 PM
Run BAT or EXE from WINDOWS on UNIX npati General 5 02-13-2008 04:00 PM
Does linux run bat files like DOS oldgi Linux - Software 6 07-05-2007 11:47 AM
how to run the *.bat file ztdep Linux - Software 8 07-19-2005 04:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:04 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration