5

I can't see this application anymore. It is a simple tool that I have always used to do some basic samba file sharing. How do I get it back?

Is there an alternate product I can use?

$ sudo apt search system-config-samba
[sudo] password for wvb: 
Sorting... Done
Full Text Search... Done
Kevin Bowen
  • 19,615
  • 55
  • 79
  • 83

2 Answers2

4

It went where all unsupported software goes: https://bugs.launchpad.net/ubuntu/+source/system-config-samba/+bug/1740419

In addition the logic of the application also has not been updated for years -- it has an option ( setting security to "share" ) that actually disables samba from running. It should have either been updated or removed years ago.

Speaking of packages that should have been removed years ago I see that gadmin-samba is still in the repository. I would suggest not installing it. It was state of the art at Version 2 of samba but now that we are at Version 4 it's actually destructive. If you run it and have problems no one will help you debug it because no one remembers how V2 of Samba works any more.

You can use nautilus-share which allows you to create a share from your file manager or use a text editor and modify /etc/samba/smb.conf directly.

Morbius1
  • 7,761
1

TL;DR - I recommend learning to just edit the smb.conf file; it's not that hard. But if you don't care and want to try anyway, the steps below might help. If you are really lazy and want to just try running my linux-mint script - I STRONGLY RECOMMEND MAKING A BACKUP FIRST (e.g. with timeshift or whatever full-system backup you use). And to be clear: I do NOT recommend just blindy running scripts off the web. I recommend using my script as a reference but I know there are folks who aren't going to listen; I usually only test my script against Mint so especially newer versions of Ubuntu might have issues that I haven't run into yet. If you find one, I don't mind you submitting an issue on my github with "system-config-samba broken on ubuntu xx.xx" etc; I might look if I have time but it's also not a priority for me. As of May 24, 2021 these steps were verified against Ubuntu 21.04 in a VM and also worked fine on LM-20 (Ubuntu 20.04 base). Also note that if you just download the script and try to run it, it will give you an error as it has some dependencies (see the README file in the script folder for instructions).

2021-May-24 Update: I had a report over on my github that some of the original links I had posted in the wget statements had stopped working. My scripts as well as this post have been updated to use new links (thanks to the note here by user N0rbert). Installing manually has been tested in Virtualbox running Ubuntu 21.04 and I was able to install system-config-samba and get it up and running. See the linked github issue page for more details. I don't recommend continuing to use system-config-samba bc A) I see python2 as a security issue since it is no longer receiving updates, B) it is outdated and never designed to warn you if you have insecure settings, and C) smb.conf is very well-documented and fairly easy to learn. But I understand that some folks might have their reasons and I'm not here to be a naysayer; so consider yourself warned :-)

For anyone looking to get system-config-samba running under Ubuntu 19/Ubuntu 20/etc, there are 4 things you need to need to do to make it work like other normal programs.

Also be forewarned that even if you get it working, it could potentially conflict with some of the newer stuff (samba3/samba4/etc). I have not seen this personally, but I only keep it around to help out some users that want to be able to edit share points and aren't too savvy with text files and it has worked fine for me to fill this use-case.


1. It's no longer in the central repos. This can be solved by downloading the appropriate legacy deb files and manually installing. AGAIN, I STRONGLY RECOMMEND MAKING A TIMESHIFT BACKUP **BEFORE** YOU APPLY THESE CHANGES

mkdir ~/Downloads/system-config-samba-debs
cd ~/Downloads/system-config-samba-debs

If on Ubuntu 20.10+, it sounds like you will need some additional

depends for libcairo2 which was apparently removed in Ubuntu 20.10

credit here goes to user N0bert for figuring this out on fslint post

wget http://archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi7_3.3-4_amd64.deb wget http://archive.ubuntu.com/ubuntu/pool/universe/p/pygobject-2/python-gobject-2_2.28.6-14ubuntu1_amd64.deb wget http://archive.ubuntu.com/ubuntu/pool/universe/p/pycairo/python-cairo_1.16.2-2ubuntu2_amd64.deb

Needed for all versions starting from Ubuntu 19.10

wget http://old-releases.ubuntu.com/ubuntu/pool/universe/p/pygtk/python-gtk2_2.24.0-6_amd64.deb wget http://old-releases.ubuntu.com/ubuntu/pool/universe/p/pygtk/python-glade2_2.24.0-6_amd64.deb wget http://archive.ubuntu.com/ubuntu/pool/universe/libu/libuser/python-libuser_0.62~dfsg-0.1ubuntu2_amd64.deb wget http://archive.ubuntu.com/ubuntu/pool/universe/s/system-config-samba/system-config-samba_1.2.63-0ubuntu6_all.deb

once all deb files are downloaded, to install running the following

Note I got a couple warnings about:

'Failed to preset unit' and

'N: Download is performed unsandboxed as root as file'

I just ignored these; they didn't matter for getting SCS running.

And if you care about security, why would you install python2 ?!

sudo apt-get install -y ./*.deb

if it worked, you should be able to find it somewhere on $PATH

which system-config-samba /usr/sbin/system-config-samba


2. After install, the libuser.conf bug will prevent it from launching. This can be solved by simply running sudo touch /etc/libuser.conf


3. The app requires root privileges (makes sense since it edits /etc/samba/smb.conf). The *.desktop shortcut is still using the old gksu command which was removed back in Ubuntu 18. We'll fix the command here since editing a shortcut is quick and easy, but be aware that the shortcut will still be broken until after you've added the Polkit exception in the next step.

The shortcut you need to edit is at /usr/share/applications/system-config-samba.desktop. We'll be replacing the line Exec=gksu system-config-samba with Exec=/usr/bin/pkexec --user root /usr/sbin/system-config-samba

You can do this manually with vim/nano or with sed by running:

sudo sed -Ei 's|^Exec=.*$|Exec=/usr/bin/pkexec --user root /usr/sbin/system-config-samba|g' /usr/share/applications/system-config-samba.desktop

4. Last you'll need to make a polkit exception so that the shortcut will work because, as mentioned earlier, this program works with a priveleged file (/etc/samba/smb.conf) and the old gksu method has long since been deprecated in favor of polkit. Adding the exception allows you to run the program from your menus and just get a graphical authentication prompt.

If you've never messed with anything polkit-related before, chances are that you won't even have the file (it doesn't exist after a fresh install).

First, to check if you even have any existing polkit exceptions, you can use ls or cat and just check for the file.

$ cat /usr/share/polkit-1/actions/org.freedesktop.policykit.pkexec.policy
cat: /usr/share/polkit-1/actions/org.freedesktop.policykit.pkexec.policy: No such file or directory

If you got 'No such file or directory' then you can just create a blank file and enter the contents (shown below). Or you can copy the one from my git repo:

wget -q https://raw.githubusercontent.com/zpangwin/linux-setup-scripts/master/mint-20/deprecated-system-config-samba/usr/share/polkit-1/actions/org.freedesktop.policykit.pkexec.policy

sudo mv org.freedesktop.policykit.pkexec.policy /usr/share/polkit-1/actions/org.freedesktop.policykit.pkexec.policy

Whether you copied mine or created a new one, make sure your permissions and ownership are set correctly:

sudo chown root:root /usr/share/polkit-1/actions/org.freedesktop.policykit.pkexec.policy;
sudo chmod 644 /usr/share/polkit-1/actions/org.freedesktop.policykit.pkexec.policy;

If you did have some existing definitions, you'll need to be able to edit XML. Since this won't be the case for most users, you'll be on your own for actually learning it but the next couple sentences should get most people by. Start with making a backup using sudo cp -a /usr/share/polkit-1/actions/org.freedesktop.policykit.pkexec.policy /usr/share/polkit-1/actions/org.freedesktop.policykit.pkexec.policy.bak. Then you'll need to manually edit the file as root so that you can avoid overwritting your existing polkit definitions. If you don't know how to do that, that should be a clue that installing a deprecated package was not a wise decision (but restoring from timeshift is easy... you did make that backup right?). Anyway, you'll want to copy part of my sample text below - but just from <action> to </action> (including the opening/closing action tags). Then paste that into your file between the last existing definiton's </action> and before the </policyconfig>.

SAMPLE POLKIT FILE (org.freedesktop.policykit.pkexec.policy):

<!DOCTYPE policyconfig PUBLIC "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN" "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
  <action id="org.freedesktop.policykit.pkexec.run-system-config-samba">
    <description>Run Samba Config</description>
    <message>Authentication is required to run Samba Config</message>
    <icon_name>system-config-samba</icon_name>
    <defaults>
      <allow_any>no</allow_any>
      <allow_inactive>no</allow_inactive>
      <allow_active>auth_admin_keep</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.exec.path">/usr/sbin/system-config-samba</annotate>
    <annotate key="org.freedesktop.policykit.exec.allow_gui">TRUE</annotate>
  </action>
</policyconfig>
zpangwin
  • 273
  • This answer has not been tested on Ubuntu or any official derivative. Please note, LM is not Ubuntu, it is off topic here. – mikewhatever Jul 07 '20 at 15:33
  • 1
    @mikewhatever I clearly noted what has and has not been tested and on which platforms. My comments are perfectly relevant to the package and distro versions discussed in this thread and is based off a related distribution. AND I LISTED IT AS A REFERENCE. If that's not good enough for you, why don't you improve my answer by testing it yourself instead of rather than adding unhelpful comments that add no additional info that I have not already noted. I feel downvoting for this reason when it is clearly noted is a bit excessive and comes off as purist bigotry rather than technical accuracy. – zpangwin Jul 08 '20 at 17:46
  • I encourage you to post answers about LM on a LM related forum. This site is about Ubuntu and official derivatives. All other distros are considered off topic. – mikewhatever Jul 08 '20 at 17:56
  • 1
    @mikewhatever My post is ABOUT the package "system-config-samba" and how to install it if it does not exist in the central repos. It is NOT about LM despite it being mentioned. The only place where LM is even mentioned is what I have currently tested and I said I will update my notes for Ubuntu specifically when/if I have time. That is no different than someone posting "you might try X but I haven't tested it". So please get off your high horse and quit interpreting one literal reference of the word "Mint" in a post as "being about LM".. Are you scanning for the word "Mint" or something? srsly – zpangwin Jul 08 '20 at 18:14
  • @zpngwin No offense, but your seemingly endless convoluted arguing denies common sense. The rules of this site are very clear, whether you like it or not. Please review the following to refresh your memory: https://askubuntu.com/help/on-topic. – mikewhatever Jul 08 '20 at 18:39
  • 3
    @mikewhatever Our on topic page says that questions about other Linux distributions are off-topic, but it does not say that answers must be tested on Ubuntu. Most answers don't mention that they have been tested at all. At worst, the answer may not work on Ubuntu and therefore be wrong, but wrong answers should not be flagged for deletion (see Why and how are some answers deleted). However, see meta for current discussion of this topic. – Zanna Jul 09 '20 at 02:24
  • @Zanna wow, thank you. I honestly thought that my entire post was deleted and done with already and would never be evaluated based on technical merit/validity. – zpangwin Jul 09 '20 at 19:09
  • @mikewhatever, FWIW even if we disagree on the validity of my post, I apologize for my lack of diplomacy in my previous comments and any offense I may have offered. – zpangwin Jul 09 '20 at 19:09
  • So… is there any replacement tool for easy managing samba users and samba shares in Ubuntu ?

    I don't think Nautilus-share has the same features as system-config-samba used to provide without being a labyrinthine system…

    – Coeur Noir Jul 26 '20 at 18:59
  • @Coeur Noir To the best of my knowledge, there aren't currently any GUI alternatives with the same features as system-config-samba. I think the general consensus I have seen while researching is to just learn how to edit the /etc/samba/smb.conf file. This is probably sound advice in many cases but isn't as desirable in a multi-user setup where the admin wants to allow users to edit smb shares without him getting involved and without messing up the file (SCS can be exempted via polkit and /etc/sudoers.d/* files fairly cleanly... conf file itself can be exempted but not as safely/cleanly) – zpangwin Aug 20 '20 at 17:50
  • ^ (continuing my previous comment). If all the computers on the network can use Samba 3 (this excludes Windows 7 but should work for Windows Server 2012, Windows 8 & 10, and most modern Linux/Mac), then one option for the allowing users to manage their own shares is to enable Samba USERSHARES. I haven't used this much myself (partly preference, partly we have one old win7 box for occasional gaming) so I can't speak much to this or any gui options for it. – zpangwin Aug 22 '20 at 02:18
  • It is better to supply a pkla file with Identity=unix-group:sudo, and ResultActive=yes, if you want to access without entering password, than using auth_admin_keep directly. auth_admin should be sufficient. – Khurshid Alam May 31 '23 at 08:23