Share Options error [SOLVED]

Questions about Wi-Fi and other network devices, file sharing, firewalls, connection sharing etc
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
scrognoid
Level 4
Level 4
Posts: 234
Joined: Sat Oct 19, 2013 8:56 pm

Share Options error [SOLVED]

Post by scrognoid »

When I try to share a folder via Share Option in the file manager I get

Code: Select all

'net usershare' returned error 255: mkdir failed on directory /var/run/samba/msg.lock: Permission denied
net usershare add: cannot convert name "Everyone" to a SID. The connection was refused. Maybe smbd is not running. 
but smbd is running

Code: Select all

>>> sudo service smbd status
● smbd.service - LSB: start Samba SMB/CIFS daemon (smbd)
   Loaded: loaded (/etc/init.d/smbd; bad; vendor preset: enabled)
   Active: active (exited) since Sat 2018-02-24 09:12:40 EST; 1h 10min ago
     Docs: man:systemd-sysv-generator(8)
  Process: 1168 ExecStart=/etc/init.d/smbd start (code=exited, status=0/SUCCESS)

Feb 24 09:12:40 jenXPS13 systemd[1]: Starting LSB: start Samba SMB/CIFS daemon (smbd)...
Feb 24 09:12:40 jenXPS13 systemd[1]: Started LSB: start Samba SMB/CIFS daemon (smbd).
>>>
This is happening in 18.3 Mate. I got a new computer and started trying to set 18.3 up like the old 17.3. I installed Samba and caja-share. It's possible I mucked something up trying to reconfigure from memory.
I notice that Samba is not installed by default. I am not married to doing things the old way. Here I am just trying to make the Public folder public, a place where local users can swap files.

And just because I saw this asked for in similar posts

Code: Select all

>>> testparm -s
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "syslog" option is deprecated
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE

# Global parameters
[global]
    server string = %h server (Samba, Ubuntu)
    server role = standalone server
    map to guest = Bad User
    obey pam restrictions = Yes
    pam password change = Yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    unix password sync = Yes
    syslog = 0
    log file = /var/log/samba/log.%m
    max log size = 1000
    dns proxy = No
    usershare allow guests = Yes
    panic action = /usr/share/samba/panic-action %d
    idmap config * : backend = tdb


[printers]
    comment = All Printers
    path = /var/spool/samba
    create mask = 0700
    printable = Yes
    browseable = No


[print$]
    comment = Printer Drivers
    path = /var/lib/samba/printers
and

Code: Select all

>>> net usershare info --long
mkdir failed on directory /var/run/samba/msg.lock: Permission denied
>>> sudo net usershare info --long
[sudo] password for jennifer:
>>> 
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
LM 21.3 Cinnamon; Dell XPS 13 (9343); Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz; 4 GB RAM
tovian
Level 5
Level 5
Posts: 630
Joined: Sun Nov 22, 2015 1:17 pm
Location: Heart of Dixie

Re: Share Options error

Post by tovian »

I always set up my shares manually - I don't use any "utility" like a file-manager. I will describe to you how I set up my shares - but - BE CAREFUL - I will not be responsible if you bork your system.

1. I make a copy of /etc/samba/smb.conf for backup purposes
- you cannot save in the same folder without elevated privileges but you can save on your desktop
2. I make another copy of that smb.conf to modify (and I name it newsmb.conf)
3. I edit my newsmb.conf to add the following...
* these are samples using my documents folder and my downloads folder... change the "username" value to your user-id
* you would put in the entire path for whatever folders you want to share
* the SHARENAME goes at the beginning - inside the [ ]
* my shares are set up for read&write
* any of the settings you do not understand you can "Google"

Code: Select all

[mnt-Documents]
    path = /home/username/Documents
    comment = Documents
    locking = yes
    delete readonly = yes
    force group = users
    create mask = 0777
    force create mode = 0770
    directory mask = 0777
    admin users = username

[mnt-Downloads]
    path = /home/username/Downloads
    comment = Downloads
    locking = yes
    delete readonly = yes
    force group = users
    create mask = 0777
    force create mode = 0770
    directory mask = 0777
    admin users = username

4. Add as many of these stanzas/paragraphs as you need - insert them after the "global" section (before printers)
5. "Sudo" to your file-manager
6. Open /etc/samba/
7. rename smb.conf to smb2.conf (or 3 or 4, etc.)
8. copy in your newsmb.conf and MAKE SURE the name is changed to smb.conf
9. Restart Samba
sudo service smbd restart
sudo service nmbd restart

Note: the value enclosed in [ ] (example: [mnt-Documents]) is the sharename you will see from other computers...
it should be a name that tells you what it is when you're seeing it from another machine
In my example (above) [mnt-Documents] lets me know that this is the documents folder on my "Mint" computer
except for the "username" change these are actual stanzas from my real (working) smb.conf
*** I use KDE, but I assume that Samba-is-Samba so that Mate-Samba also uses smb.conf in the /etc/samba/ folder. If not, this won't work.
“I think that this situation absolutely requires a really futile and stupid gesture be done on somebody's part"
"We're just the guys to do it”

Animal House
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Share Options error

Post by catweazel »

scrognoid wrote: Sat Feb 24, 2018 12:17 pm I am not married to doing things the old way.
Is there a reason you're using samba? NFS is far easier to setup, especially if you don't need Windwoes machines to connect to the shares. However NFS, AFAIK, has been supported in various ways in Windwoes since 7.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
scrognoid
Level 4
Level 4
Posts: 234
Joined: Sat Oct 19, 2013 8:56 pm

Re: Share Options error

Post by scrognoid »

NFS sounds good. How do I set it up?
LM 21.3 Cinnamon; Dell XPS 13 (9343); Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz; 4 GB RAM
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Share Options error

Post by catweazel »

scrognoid wrote: Mon Feb 26, 2018 8:27 pm NFS sounds good. How do I set it up?
On the server, it's as simple as...

Code: Select all

    sudo su
    apt update
    apt install nfs-kernel-server
    mkdir /media/<user>/<mount_name>
    nano -w /etc/fstab
        UUID=<mount_uuid /media/<user>/<mount_name> ext4 defaults,rw 0   0
    mount -a
    usermod -a -G nogroup $USER
    nano /etc/exports
        /media/boot/<mount_name> <client_ip>(rw,sync,no_subtree_check)
    mount -a
    systemctl restart nfs-kernel-server
    ufw allow from <client_ip> to any port nfs
    ufw status
    exit
On the client, you just install nfs-common then mount the remote share:
mount -o vers=3 <server_ip>:/media/<user>/<mount_name> /media/<user>/<mount_name>

You'll find full instructions here.

There's a step listed as: host$ sudo chown nobody:nogroup /var/nfs/general, which I skip because the server and client only have one user, which is me.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
scrognoid
Level 4
Level 4
Posts: 234
Joined: Sat Oct 19, 2013 8:56 pm

Re: Share Options error [SOLVED]

Post by scrognoid »

I purged and re-installed samba and it got fixed.

Thanks for the suggestions. I will revisit NFS someday, but today I just wanted to right-click and share a folder.
LM 21.3 Cinnamon; Dell XPS 13 (9343); Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz; 4 GB RAM
Locked

Return to “Networking”