Linux посмотреть пароль samba

unixforum.org

Где найти пароли в самбе? Вобщем ситуация следующая: старый админ оставил 1 пароль и имя пользователя к нему и сказал что он распространяется на все ресурсы. А сейчас когда у меня возникла проблема подключить локальные ресурсы с линуксового сервака на виндовый, то там возник запрос имени пользователя и пароля.. я ввожу его пароль некоторые папки шарятся, а на некоторых другой пароль оказывается! или пользователь другой. как их поменять? в каталоге /etc/samba нашёл файл smbpasswd но там какая-то непонятная фигня написаннна ничего не могу понять ((

Re: пароли в самбе

Сообщение Goodvin » 11.09.2007 19:15

Где найти пароли в самбе? Вобщем ситуация следующая: старый админ оставил 1 пароль и имя пользователя к нему и сказал что он распространяется на все ресурсы. А сейчас когда у меня возникла проблема подключить локальные ресурсы с линуксового сервака на виндовый, то там возник запрос имени пользователя и пароля.. я ввожу его пароль некоторые папки шарятся, а на некоторых другой пароль оказывается! или пользователь другой. как их поменять? в каталоге /etc/samba нашёл файл smbpasswd но там какая-то непонятная фигня написаннна ничего не могу понять ((

Re: пароли в самбе

Сообщение 0kurok » 12.09.2007 07:11

Re: пароли в самбе

Сообщение Goodvin » 12.09.2007 08:23

1, А что это там за огрызок из двух строк в самом верху конфига ?
2. Смотри внимательно на параметр valid users в секциях твоих сетевых шар.
3. Смотри внимательно на параметр unix password sync = Yes
Он говорит о том, что пароли самбовые синхронизируются с паролями системными.
4. А что выдает команда testparm ?

Re: пароли в самбе

Сообщение 0kurok » 12.09.2007 12:29

1 что за огрызок сам без понятия
2 С юзерами разобрался, как я понимаю там прописываются имена для входа пользователя на расшаренный ресурс
3. Насчёт поролей получается что у всех пользователей пароли синхронизарованны с системными? А как тогда узнать какой пароль у каждого пользователя? Посмотреть системные пороли??
4 testparm:
Load smb config files from /etc/samba/smb.conf
Unknown parameter encountered: «client code page»
Ignoring unknown parameter «client code page»
Unknown parameter encountered: «character set»
Ignoring unknown parameter «character set»
Processing section «[homes]»
Processing section «[printers]»
Processing section «[onty]»
Processing section «[ko]»
Processing section «[mail]»
Processing section «[thbat]»
Processing section «[distrib]»
Processing section «[dania]»
Processing section «[garant]»
Processing section «[cdrom]»
Processing section «[urist]»
Loaded services file OK.
Server role: ROLE_DOMAIN_PDC
Press enter to see a dump of your service definitions

Читайте также:  Кодеки yandex browser linux

Источник

Где Samba хранит пароли. Как извлечь имена пользователей и паролей Samba (РЕШЕНО)

Данная заметка посвящена базе данных паролей Samba. В ней даны ответы на популярные вопросы о том, где хранятся пароли Samba и как выполнить популярные действия с базой данных паролей Samba.

Для установки пароля Samba используется команда:

sudo smbpasswd -a ПОЛЬЗОВАТЕЛЬ

Если вы хотите, чтобы у пользователя не было пароля, то укажите опцию -n.

В каком файле Samba хранит пароли?

Пароли Samba хранятся в файле /var/lib/samba/private/passdb.tdb.

В зависимости от дистрибутива и версии Samba, путь до файла passdb.tdb может быть другим.

В каком формате файл паролей Samba passdb.tdb?

Файл passdb.tdb это бинарный, а не простой текстовый файл.

Файл passdb.tdb можно открыть с помощью утилиты tdbtool, но этот файл не предназначен для редактирования пользователем напрямую, в том числе с помощью утилиты tdbtool. Также с помощью утилиты pdbedit можно экспортировать и импортировать содержимое этого файла.

tdbtool — это инструмент для отображения и изменения содержимого файлов Samba TDB (Trivial DataBase). Каждая из перечисленных ниже команд может быть введена в интерактивном режиме или предоставлена в командной строке.

Чтобы открыть файл passdb.tdb необходимо запустить утилиту tdbtool с правами root, иначе у неё не хватит прав даже для просмотра этого файла:

Затем выполните команду open указав путь до файла, который вы хотите открыть:

open /var/lib/samba/private/passdb.tdb

Если во время открытия не произошло ошибок (например из-за того, что указан неправильный путь), то ничего не будет выведено.

Для вывода справки введите

Популярные команды, которые могут вам пригодиться:

распечатать хеш-таблицу базы данных и список свободных мест

показать содержимое базы данных в качестве строк

вывести список ключей базы данных в качестве строк

вывести сводную информацию о базе данных

Можно ли просмотреть или извлечь пароли из базы данных Samba?

Нет, невозможно посмотреть или извлечь пароли из файла passdb.tdb. Более того, в файле passdb.tdb не хранятся пароли в виде простого текста, база данных Samba содержит только хеши паролей.

Алгоритм используемого хеша — NTLM. Онлайн генератор хешей: LM/NTLM: https://suip.biz/ru/?act=ntlm-hash-generator

Вы можете экспортировать хеши в виде шестнадцатеричной строки следующей командой:

Следующая команда экспортирует все данные, включая хеши:

sudo pdbedit -e smbpasswd:/root/samba-users.backup

Как просмотреть имена пользователей Samba?

Имена пользователей вы можете посмотреть следующими командами:

sudo pdbedit -L sudo pdbedit -L -v

Как удалить одного пользователя из базы данных Samba?

Для удаления используйте опцию -x (—delete). Также необходимо указать имя пользователя с опцией -u, например:

Читайте также:  Где хранятся файлы конфигурации linux

Как стереть базу данных с паролями Samba?

Следующая команда сотрёт всю базу данных с паролями Samba:

sudo tdbtool /var/lib/samba/private/passdb.tdb erase

Как управлять аккаунтами Samba?

Опцию -c|—account-control ФЛАГ можно использовать с командой pdbedit при добавлении или изменении учётной записи пользователя. Он укажет свойство управления учётными записями пользователей. Возможные флаги перечислены ниже:

  • N: No password required
  • D: Account disabled
  • H: Home directory required
  • T: Temporary duplicate of other account
  • U: Regular user account
  • M: MNS logon user account
  • W: Workstation Trust Account
  • S: Server Trust Account
  • L: Automatic Locking
  • X: Password does not expire
  • I: Domain Trust Account

Пример: -c «[X ]»

Связанные статьи:

Источник

Thread: Samba password file

ctrlER is offline5 Cups of Ubuntu

Samba password file

Hi.
I’ve searched my hard drive but I’m not finding the file where samba is keeping its passwords. I’m trying to sync my user passwords with my samba passwords (and I’m getting nowhere) and in the process of doing that I search for it and couldn’t find it.
Can anyone help me with that?

HalPomeranz is offlineQuad Shot of Ubuntu

Re: Samba password file

The default Samba configuration on my Hardy system puts the password database in /var/lib/samba/passdb.tdb. Note that this is a binary database, not a flat text file, so you won’t just be able to copy password entries from your /etc/shadow file into passdb.tdb.

You can tell Samba to use a text file by setting the «passdb backend» parameter in /etc/samba/smb.conf. But Samba uses a different password hashing algorithm from the one in /etc/shadow, so you wouldn’t be able to just copy entries from one file to another anyway.

What you have to do is edit your smb.conf file and set «unix password sync = yes» and then tell your users to change their passwords using the smbpasswd command instead of the usual passwd command. I know of no way to sync your existing user account passwords with the Samba password database other than forcing a change to all user passwords via smbpasswd (whether your users do it themselves or you do it for them).

Источник

Where Samba stores passwords. How to Extract Samba Usernames and Passwords (SOLVED)

This article is about the Samba password database. It answers popular questions about where Samba passwords are stored and how to perform common actions on the Samba password database.

To set the Samba password, use the command:

If you want the user to have no password, then specify the -n option.

In which file does Samba store passwords?

Samba passwords are stored in the /var/lib/samba/private/passdb.tdb file.

Depending on the distribution and version of Samba, the path to the passdb.tdb file may be different.

Читайте также:  Linux символ домашней директории

What is the format of the Samba password file passdb.tdb?

The passdb.tdb file is a binary file, not a plain text file.

The passdb.tdb file can be opened with the tdbtool utility, but this file is not meant to be edited by the user directly, including with the tdbtool utility. You can also export and import the contents of this file using the pdbedit utility.

tdbtool is a tool for displaying and modifying the contents of Samba TDB (Trivial DataBase) files. Each of the commands listed below can be entered interactively or provided on the command line.

To open the passdb.tdb file, you must run the tdbtool utility as root, otherwise it will not have enough rights even to view this file:

Then run the “open” command specifying the path to the file you want to open:

open /var/lib/samba/private/passdb.tdb

If there were no errors during the opening (for example, due to the fact that the wrong path was specified), then nothing will be displayed.

Popular commands you might find useful:

print the hash table of the database and the list of free spaces

show database contents as strings

print a list of database keys as strings

display summary information about the database

Is it possible to view or extract passwords from the Samba database?

No, it is not possible to view or extract passwords from the passdb.tdb file. Moreover, the passdb.tdb file does not store passwords in plain text, the Samba database contains only password hashes.

The hash algorithm used is NTLM. Online LM/NTLM hash generator: https://suip.biz/?act=ntlm-hash-generator

You can export hashes as a hex string with the following command:

The following command will export all data, including hashes:

sudo pdbedit -e smbpasswd:/root/samba-users.backup

How to view Samba usernames?

You can view usernames with the following commands:

sudo pdbedit -L sudo pdbedit -L -v

How to remove a single user from a Samba database?

To delete, use the -x (—delete) option. You also need to specify the username with the -u option, for example:

How to wipe the Samba password database?

The following command will wipe the entire Samba password database:

sudo tdbtool /var/lib/samba/private/passdb.tdb erase

How to manage Samba accounts?

The -c|—account-control FLAG option can be used with the pdbedit command when adding or modifying a user account. It will specify the user account control property. Possible flags are listed below:

  • N: No password required
  • D: Account disabled
  • H: Home directory required
  • T: Temporary duplicate of other account
  • U: Regular user account
  • M: MNS logon user account
  • W: Workstation Trust Account
  • S: Server Trust Account
  • L: Automatic Locking
  • X: Password does not expire
  • I: Domain Trust Account

Example: -c «[X ]»

Источник

Оцените статью
Adblock
detector