Различия
Здесь показаны различия между двумя версиями данной страницы.
Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия | ||
wiki:руководство_по_ubuntu_server:сеть_windows:samba_ad_integration [2012/09/20 17:29] [Интеграция Samba с Active Directory] |
wiki:руководство_по_ubuntu_server:сеть_windows:samba_ad_integration [2012/11/12 21:56] (текущий) [Доступ к Windows ресурсу] |
||
---|---|---|---|
Строка 10: | Строка 10: | ||
====Доступ к Samba ресурсу==== | ====Доступ к Samba ресурсу==== | ||
- | Another, use for Samba is to integrate into an existing Windows network. Once part of an Active Directory domain, Samba can provide file and print services to AD users. | + | Другое использование Samba - это интеграция в существующую сеть Windows. Став частью домена Active Directory, Samba сможет предоставлять файловый сервис и сервис печати пользователям AD. |
- | The simplest way to join an AD domain is to use Likewise-open. For detailed instructions see the Likewise Open Installation and Administration Guide. | + | Самый простой способ подсоединиться к AD домену - это использование **Likewise-open**. Для подробных инструкций обратитесь к руководству [[http://www.likewise.com/resources/documentation_library/manuals/open/likewise-open-guide.html|Likewise Open Installation and Administration Guide]]. |
- | Once part of the Active Directory domain, enter the following command in the terminal prompt: | + | Став частью Active Directory домена, введите следующую команду в терминале: |
- | + | <code>sudo apt-get install samba smbfs smbclient</code> | |
- | sudo apt-get install samba smbfs smbclient | + | |
- | + | ||
- | Next, edit /etc/samba/smb.conf changing: | + | |
+ | Далее измените в /etc/samba/smb.conf следующее: | ||
+ | <code> | ||
workgroup = EXAMPLE | workgroup = EXAMPLE | ||
... | ... | ||
Строка 28: | Строка 27: | ||
idmap uid = 50-9999999999 | idmap uid = 50-9999999999 | ||
idmap gid = 50-9999999999 | idmap gid = 50-9999999999 | ||
+ | </code> | ||
- | Restart samba for the new settings to take effect: | + | Перезапустите samba чтобы применить новые настройки: |
+ | <code> | ||
sudo restart smbd | sudo restart smbd | ||
sudo restart nmbd | sudo restart nmbd | ||
+ | </code> | ||
- | You should now be able to access any Samba shares from a Windows client. However, be sure to give the appropriate AD users or groups access to the share directory. See Securing a Samba File and Print Server for more details. | + | Теперь вы можете подсоединиться к любому Samba ресурсу из клиента Windows. Однако убедитесь, что предоставили соответствующим пользователям и группам AD доступ к каталогу разделяемого ресурса. Смотрите подробности в разделе [[wiki:руководство_по_ubuntu_server:сеть_windows:securing_samba_servers|Защита серверов Samba]]. |
====Доступ к Windows ресурсу==== | ====Доступ к Windows ресурсу==== | ||
- | Now that the Samba server is part of the Active Directory domain you can access any Windows server shares: | + | Теперь, поскольку Samba сервер является частью Active Directory домена, вы можете получить доступ к любым разделяемым ресурсам Windows сервера: |
- | To mount a Windows file share enter the following in a terminal prompt: | + | 1. Для монтирования файлового ресурса Windows введите следующую команду в терминале: |
+ | <code>mount.cifs //fs01.example.com/share mount_point</code> | ||
+ | Также существует возможность доступа к разделяемым ресурсам на компьютерах не являющимися частью AD домена, но тогда потребуется предоставить имя пользователя и пароль. | ||
- | mount.cifs //fs01.example.com/share mount_point | + | 2. Для монтирования ресурса в процессе загрузки, поместите запись в /etc/fstab, например: |
+ | <code>//192.168.0.5/share /mnt/windows cifs auto,username=steve,password=secret,rw 0 0</code> | ||
- | It is also possible to access shares on computers not part of an AD domain, but a username and password will need to be provided. | + | 3. Другой способ копировать файлы с Windows сервера - это использование утилиты **smbclient**. Для получения списка файлов на ресурсе Windows: |
+ | <code>smbclient //fs01.example.com/share -k -c "ls"</code> | ||
- | To mount the share during boot place an entry in /etc/fstab, for example: | + | 4. Для копирования файла с ресурса введите: |
+ | <code>smbclient //fs01.example.com/share -k -c "get file.txt"</code> | ||
+ | Это скопирует файл file.txt в текущий каталог. | ||
- | //192.168.0.5/share /mnt/windows cifs auto,username=steve,password=secret,rw 0 0 | + | 5. Для копирования файла на разделяемый ресурс: |
+ | <code>smbclient //fs01.example.com/share -k -c "put /etc/hosts hosts"</code> | ||
+ | Это скопирует /etc/hosts в %%//fs01.example.com/share/hosts%%. | ||
- | Another way to copy files from a Windows server is to use the smbclient utility. To list the files in a Windows share: | + | 6. Опция **-c**, использованная выше, позволяет вам выполнять в smbclient одну команду за раз. Это удобно для использования в сценариях и при небольших файловых операциях. Для получения приглашения **%%smb: \>%%**, аналогичного приглашению FTP, где вы сможете выполнять обычные команды с файлами и каталогами, просто выполните: |
- | + | <code>smbclient //fs01.example.com/share -k</code> | |
- | smbclient //fs01.example.com/share -k -c "ls" | + | |
- | + | ||
- | To copy a file from the share, enter: | + | |
- | + | ||
- | smbclient //fs01.example.com/share -k -c "get file.txt" | + | |
- | + | ||
- | This will copy the file.txt into the current directory. | + | |
- | + | ||
- | And to copy a file to the share: | + | |
- | + | ||
- | smbclient //fs01.example.com/share -k -c "put /etc/hosts hosts" | + | |
- | + | ||
- | This will copy the /etc/hosts to //fs01.example.com/share/hosts. | + | |
- | + | ||
- | The -c option used above allows you to execute the smbclient command all at once. This is useful for scripting and minor file operations. To enter the smb: \> prompt, a FTP like prompt where you can execute normal file and directory commands, simply execute: | + | |
- | + | ||
- | smbclient //fs01.example.com/share -k | + | |
- | + | ||
- | Replace all instances of fs01.example.com/share, //192.168.0.5/share, username=steve,password=secret, and file.txt with your server's IP, hostname, share name, file name, and an actual username and password with rights to the share. | + | |
+ | <note>Замените все вхождения **//fs01.example.com/share//**, **//%%//192.168.0.5/share%%//**, **//file.txt//** и **//username=steve,password=secret//** на сетевое имя и адрес вашего сервера, название ресурса, имя файла, а также реальные имя пользователя и пароль с правами доступа к ресурсу.</note> | ||
====Ссылки==== | ====Ссылки==== | ||
- | For more smbclient options see the man page: man smbclient, also available online. | + | -- Для дополнительных опций smbclient смотрите руководство man smbclient также доступное [[http://manpages.ubuntu.com/manpages/precise/en/man1/smbclient.1.html|в сети]]. |
- | + | -- Страница руководства [[http://manpages.ubuntu.com/manpages/precise/en/man8/mount.cifs.8.html|man mount.cifs]] также полезна для в качестве дополнительной информации. | |
- | The mount.cifs man page is also useful for more detailed information. | + | -- Страница [[https://help.ubuntu.com/community/Samba|Ubuntu Wiki Samba]]. |
- | + | ||
- | The Ubuntu Wiki Samba page. | + | |
---- | ---- |