Различия
Здесь показаны различия между двумя версиями данной страницы.
Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия | ||
wiki:руководство_по_ubuntu_server:сеть_windows:samba_ad_integration [2012/09/20 17:46] [Доступ к Windows ресурсу] |
wiki:руководство_по_ubuntu_server:сеть_windows:samba_ad_integration [2012/11/12 21:56] [Доступ к Windows ресурсу] |
||
---|---|---|---|
Строка 39: | Строка 39: | ||
====Доступ к 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> | |
- | Another way to copy files from a Windows server is to use the smbclient utility. To list the files in a Windows share: | + | Это скопирует /etc/hosts в %%//fs01.example.com/share/hosts%%. |
- | + | ||
- | 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: | + | |
+ | 6. Опция **-c**, использованная выше, позволяет вам выполнять в smbclient одну команду за раз. Это удобно для использования в сценариях и при небольших файловых операциях. Для получения приглашения **%%smb: \>%%**, аналогичного приглашению FTP, где вы сможете выполнять обычные команды с файлами и каталогами, просто выполните: | ||
<code>smbclient //fs01.example.com/share -k</code> | <code>smbclient //fs01.example.com/share -k</code> | ||
- | 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. | + | |
---- | ---- |