Net usershare вернул ошибку 255 net usershare usershares are currently disabled

Прежде всего, что такое ошибка Samba 255? Что ж, это ошибка, которую мы получаем, когда в Ubuntu (например), мы пытаемся предоставить общий доступ к папке и не можем, потому что он сообщает нам:

«Сетевая папка» вернула ошибку 255: net usershare: не удалось открыть каталог / var / lib / samba / usershares. Ошибка Разрешение отклонено У вас нет разрешения на создание общего доступа. Попросите администратора предоставить вам разрешения на создание общего ресурса.

Это случилось со мной, когда я попытался создать общую папку на одном из компьютеров моих пользователей, чтобы я мог удобно обмениваться файлами с виртуальной машиной Windows XP, работающей на Virtualbox.

В случае Ubuntu решение простое, потому что я все решил, выполнив в терминале:

sudo chmod 777 /var/lib/samba/usershares

Но это может не быть решением для других. Например, в случае с Debian это можно легко решить, добавив нашего пользователя в группу sambashare.

# addgroup usuario sambashare

Депутат только что сказал мне, что еще одно возможное решение — добавить в файл /etc/самба/smb.conf параметр: Только владелец доли пользователя = Ложь

Но допустим, мы хотим чего-то большего. В этом случае мы не хотим, чтобы он запрашивал у нас имя пользователя и пароль для доступа к общей папке. Что ж, для этого мы создаем папку в / media:

# mkdir /media/compartir
# chmod -R 777

А потом добавляем в конец файла /etc/samba/smb.conf:

[документы] комментарий = Путь к общим документам = / media / share public = да для записи = да

И что ж, в некоторых случаях нам нужно перезапустить Samba:

# /etc/init.d/samba restart

Теперь с виртуальной машины мне просто нужно ввести Windows Explorer:

\192.168.X.Xcompartir

И готово ..

Содержание статьи соответствует нашим принципам редакционная этика. Чтобы сообщить об ошибке, нажмите здесь.

  • Печать

Страницы: [1] 2  Все   Вниз

Тема: Ошибка 255 при запуске ‘net usershare’  (Прочитано 37371 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
lcnet

Добрый день!

После обновления с Ubunta 9.04 до 9.10 при попытке расшарить папку периодически вылетает эта ошибка:

«Ошибка 255 при запуске ‘net usershare’: net usershare add: cannot convert name «Everyone» to a SID. Memory allocation error»

Пробовал рестатить самбу «sudo /etc/init.d/samba restart»
Пробовал расшаривать через консоль с помощью «net usershare»

Самое интересное что ошибка не постоянная, появляется после перезагрузки системы и исчезает после первой же перезагрузки ситемы, а бывает что раз по 10 рестартить приходится.

Как это лечить?

З.Ы. Сильно не ругаться я новичок в Линуксоводстве)


Оффлайн
kosh59

лечится оно добавлением в файл /etc/samba/smb.conf
строчки

usershare owner only = falseну и конечно перезапуском самбы

sudo /etc/init.d/samba restart


Оффлайн
nocturna

Та-же проблема.

Ошибка 255 при запуске 'net usershare': net usershare add: cannot convert name "Everyone" to a SID. Memory allocation error.
Добавление usershare owner only = false не помогло…


Оффлайн
S.Dedal

У меня похожая проблема. Поставил Ubuntu 9.10 второй системой после Windows 7, при попытке расшарить папку, находящуюся на винте с файловой системой ntfs получаю пресловутую ошибку 255. Прописал строчку usershare owner only = false в /etc/samba/smb.conf следующим образом:

Но эта ошибка все равно появляется, перезапуск самбы и перезагрузка не помогли.
Возможно что-то сделал не так или прописал не туда, т.к. Ubuntu поставил недавно и в ней я нубас полнейший.


Оффлайн
lcnet

kosh59, Неее тут другое… такое ощущение что все ошибки с ‘net usershare’ именуются Ошибка 255…

Вот пример:
«Ошибка 255 при запуске ‘net usershare’: net usershare add: cannot share path /media/disk as we are restricted to only sharing directories we own. Ask the administrator to add the line «usershare owner only = False» to the [global] section of the smb.conf to allow this«
— Эта ошибка значит вы пытаетесь сделать общедоступным диск или папку, владельцем которой ваша учётная запись не является.

Как ты и горишь надо в etc/samba/smb.conf и в секцию [global] в подраздел Misc дописать строчку:

usershare owner only = False.

Это разрешит нам как пользователю открывать общий доступ к чужим объектам. Так, диски находятся в ведении суперпользователя.

 Опять таки ошибка с номером 255
«Ошибка 255 при запуске ‘net usershare’: net usershare add: cannot convert name «Everyone» to a SID. Memory allocation error«
— Чем она лечится я так и не понял, или мои махинации помогли то-ли этот глюк прошел сам через пару обновлений…

Я делал так.
1) Примонтировал диски таким нехитрым способом
sudo gedit /etc/mtab
скопировал нужное и в вставил в
sudo gedit /etc/fstab
заменив fuseblk на ntfs-3g
1.2) строка «usershare owner only = False«. у меня уже была прописана… если у Вас нет, вставьте на всяк пожарный
2) Поставил самбу «Sudo apt-get install samba«,
3) Расшарил папки через ГУИ Samb’ы «Система/Администрирование/Samba» назначив там нужные права доступа.

« Последнее редактирование: 27 Января 2010, 20:44:22 от lcnet »


Оффлайн
netsloff

попробуйте так sudo /etc/init.d/samba restart Если будет так (ок) (fail) то сделайте так sudo apt-get install —reinstall samba-common-bin а потом так sudo /etc/init.d/samba restart мне помогло…


Оффлайн
stepnoy

мне это не помогло

попробуйте так sudo /etc/init.d/samba restart Если будет так (ок) (fail) то сделайте так sudo apt-get install —reinstall samba-common-bin а потом так sudo /etc/init.d/samba restart мне помогло…

вот такая постоянно ошибка

кто может подсказать в чем тут проблема?


Оффлайн
GrafTrahula

можно попробовать запустить sudo nautilus и через него повторить расшаривание.мне помогло


Оффлайн
simulyant

У меня при расшаривании папки через nautilus возникает эта ошибка «Ошибка 255 при запуске ‘net usershare’: net usershare add: cannot convert name «Everyone» to a SID. Invalid parameter»

— добавление usershare owner only = false в /etc/samba/smb.conf — не помогло
— Переустановка samba-common-bin — sudo apt-get install —reinstall samba-common-bin а потом так sudo /etc/init.d/samba restart — не помогло
— Запуск sudo nautilus не помог

Что делать?

Ubuntu 10.04 Netbook Edition


Оффлайн
Kiberman

У меня при расшаривании папки через nautilus возникает эта ошибка «Ошибка 255 при запуске ‘net usershare’: net usershare add: cannot convert name «Everyone» to a SID. Invalid parameter»

— добавление usershare owner only = false в /etc/samba/smb.conf — не помогло
— Переустановка samba-common-bin — sudo apt-get install —reinstall samba-common-bin а потом так sudo /etc/init.d/samba restart — не помогло
— Запуск sudo nautilus не помог

Что делать?


тоже такая же ошибка,решения пока не нашёл может кто из постояльцев ответит

« Последнее редактирование: 09 Марта 2011, 15:49:08 от Kiberman »


Оффлайн
gregory5

Расшаривай через конфиг, а не наутилус, и да судо наутилус запуститься без поддержки сети из за кривизны в шине, запускать нужно sudo dbus-launch nautilus, но не расшаривай наутилусом, криво оно работает


Оффлайн
0konstantin0

как я понял такое бывает если дополнительно установить сервер самба из репозитория помимо стандартного….


Оффлайн
IAmABanana

Была такая же проблема с расшариванием собственых папок через роутер. Решилось всё очень просто: идём Система>Администрирование>опубликованные папки и добавляем всё что нужно.

KXStudio 14.04 дуалбут с Win7
Lenovo Thinkpad X230


Оффлайн
ps1x0

Здравствуйте, уважаемые. Была похожая проблема: не мог расшарить папку с полным доступом на ntfs разделе.
Победил с помощью добавления строчки usershare owner only = false в секцию [global] /etc/samba/smb.conf
Потом возникла проблема с предоставлением гостевого доступа к расшаренной папке. Не знаю что тут сыграло определяющую роль, но во-первых убрал sticky-бит c usershares

sudo chmod -t /var/lib/samba/usershares
во-вторых примонтировал раздел с ntfs c правами drwxrwxrwx, путем изменения umask=007 на umask=000. В итоге строчка в fstab с ntfs разделом выглядела следующим образом:

UUID=C53D4B0FAEB1E5A1 /media/data     ntfs    defaults,umask=000,gid=46 0       0
Решил на всякий случай написать, может кому-нибудь пригодится. Ubuntu 10.04 LTS

« Последнее редактирование: 18 Ноября 2011, 10:56:02 от ps1x0 »

Если отдавать ужин врагу, можно приобрести друга (с)


Оффлайн
denisyan

проблема решилась так. Началось это после установки сервера и изменении прав вна каталог VAR. Я вернул права на место и через рута (sudo nautilus) назначил общий доступ. Папка появилась в сети после перезагрузки


  • Печать

Страницы: [1] 2  Все   Вверх

My issue initially started out with trying to share with Samba Shares. On my main SSD I can share anything to my desktop but I added a secondary hard drive and thats where my issues started. No matter what I do I cannot share with Samba Shares to my Desktop. (The machine running Ubuntu is my personal network server). As of right now this is where I’m stuck at and still cannot share a folder from my secondary hard drive.

Screenshot of error code

Permissions

So sorry, I forgot to add the screenshot.

I’ve added #usershare owner only=false to the [global] section of the smb.conf file since I read that it fixed others with the same problem but it did not work for me.

    #======================= Global Settings =======================

[global]


## Browsing/Identification ###

#usershare owner only=false
# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
    server string = %h server (Samba, Ubuntu)

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
#   wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
;   wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
   dns proxy = no

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
;   interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself.  However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
;   bind interfaces only = yes



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
   max log size = 1000

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
#   syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
   syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
   panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller". 
#
# Most people will want "standalone sever" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
   server role = standalone server

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.  
   passdb backend = tdbsam

   obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
   unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Entersnews*spassword:* %nn *Retypesnews*spassword:* %nn *passwordsupdatedssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
   pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
   map to guest = bad user

########## Domains ###########

#
# The following settings only takes effect if 'server role = primary
# classic domain controller', 'server role = backup domain controller'
# or 'domain logons' is set 
#

# It specifies the location of the user's
# profile directory from the client point of view) The following
# required a [profiles] share to be setup on the samba server (see
# below)
;   logon path = \%Nprofiles%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
#   logon path = \%N%Uprofile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
;   logon drive = H:
#   logon home = \%N%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
;   logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe.  The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

# This allows machine accounts to be created on the domain controller via the 
# SAMR RPC pipe.  
# The following assumes a "machines" group exists on the system
; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u

# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.  
; add group script = /usr/sbin/addgroup --force-badname %g

############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
;   include = /home/samba/etc/smb.conf.%m

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
;   idmap uid = 10000-20000
;   idmap gid = 10000-20000
;   template shell = /bin/bash

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is disabled.
;   usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
   usershare allow guests = yes

#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \serverusername
;[homes]
;   comment = Home Directories
;   browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
;   read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
;   create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
;   directory mask = 0700

# By default, \serverusername shares can be connected to by anyone
# with access to the samba server.
# Un-comment the following parameter to make sure that only "username"
# can connect to \serverusername
# This might need tweaking when using external authentication schemes
;   valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   read only = yes

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin

This document (3007125) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Desktop 10

Situation

When trying to use «Sharing Options» on the right click menu of
Nautilus the following error is received: «‘net usershare’ returned
error 255: net usershare: usershares are currently disabled»

Resolution

Before the sharing options can be used they must first be enabled
in the Yast system. This option is controlled under the Yast,
Network Services, Windows Domain Membership. In there you will see
an option to allow users to share their directories and the
permissions that you want to give those directories. Once that
option is checked then you should no longer receive the
error.

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented «AS IS» WITHOUT WARRANTY OF ANY KIND.

  • Document ID:3007125
  • Creation Date:
    05-Jun-2006
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Desktop

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

Join Our Community

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.

Go to Customer Center

Translation(s): Русский


SystemAdministration


Contents

    1. Установка
    2. Настройка
    3. Решение неполадок
  1. Неполадки

    1. Заключение
    2. Ссылки

Данное краткое руководство посвящено быстрой базовой настройке Samba.

Samba — пакет программ, которые позволяют обращаться к сетевым дискам и принтерам на различных операционных системах по протоколу SMB/CIFS. Имеет клиентскую и серверную части. Является свободным программным обеспечением, выпущена под лицензией GPL.

Установка

# apt-get install samba

Настройка

Добавляем пользователя в базу самбы:

# smbpasswd -a имя_пользователя

Активируем его:

# smbpasswd -e имя_пользователя

В большинстве случаев, при домашнем использовании, все должно работать и со стандартным smb.conf.

Решение неполадок

Если при попытке создать общий ресурс через Nautilus или Konqueror Вам сообщается об ошибке :

* ‘net usershare’ returned error 255: net usershare: usershares are currently disabled

в таком случае проделайте следующее : откройте для редактирования файл /etc/samba/smb.conf и отредактируйте секцию [global] следующим образом :

[global]
  .....
  usershare path = /var/lib/samba/usershare
  usershare max shares = 100
  usershare allow guests = yes
  usershare owner only = False
  read only = No
  guest only = Yes
  guest ok = Yes
  .....

Сохраните файл и закройте текстовый редактор. Далее создайте каталог ‘usershare’ где Samba будет хранить списки общих папок, разрешив чтение и запись

# mkdir /var/lib/samba/usershares
# chown root:sambashare /var/lib/samba/usershares
# chmod 1770 /var/lib/samba/usershares
# usermod -a -G sambashare <имя пользователя>

И перезапустите Samba :

# /etc/init.d/samba restart

Завершите сеанс и войдите в него вновь. Теперь у вас должна появиться возможность настраивать общий доступ samba, используя графический интерфейс. Например, в Dolphin вы можете нажать правую кнопку мыши на любом каталоге и предоставить для него общий доступ в сети.

Неполадки

* NT_STATUS_UNSUCCESSFUL

Находим следующую строку в smb.conf

 ; name resolve order = lmhosts host wins bcast

раскомментируем и изменяем на

 name resolve order = lmhosts wins bcast host

в секции [global]

Добавлем в эту же секцию

 local master = Yes
 browseable = yes

Если хотим, чтобы мы были видны в локальной сети

И перезапустите Samba :

# /etc/init.d/samba restart

Если у вас возникли проблемы при доступе к защищенному паролем общему ресурсу на Windows попробуйте добавить

 [global]
 # THE LANMAN FIX
 client lanman auth = yes
 client ntlmv2 auth = no

Заключение

Тестируем настройки

testparm -s
# Примерный рабочий smb.conf

workgroup = WORKGROUP
server string = Samba Server

[global]
        server string = Samba Server
        usershare path = /var/lib/samba/usershare
        usershare max shares = 100
        usershare allow guests = yes
        usershare owner only = False
        read only = No
        guest only = Yes
        guest ok = Yes

[printers]
        comment = All Printers
        path = /var/spool/samba
        read only = Yes
        guest ok = Yes
        printable = Yes
        browseable = Yes
''read only = No'' возможно правильнее всего вынести из [global] в отдельную шару, в данном случае [music]. 
Но в этом случае, шары созданные через файловый мененджер и не прописанные непосредственно в smb.conf станут доступны только для чтения

Ссылки

* http://ru.gentoo-wiki.com/wiki/Настройка_Samba_за_5_минут

* https://wiki.archlinux.org/index.php/Samba_(Русский)


CategorySystemAdministration CategoryNetwork CategorySoftware

  • Net user add системная ошибка 5
  • Net use системная ошибка 59 непредвиденная сетевая ошибка
  • Net use системная ошибка 53 не найден сетевой путь
  • Net use системная ошибка 1311
  • Net use системная ошибка 1231