Ubuntu Server Guide
Accessing a Windows Share
Download 1.23 Mb. Pdf ko'rish
|
ubuntu-server-guide (1)
Accessing a Windows Share
Now that the Samba server is part of the Active Directory domain you can access any Windows server shares: • To mount a Windows file share enter the following in a terminal prompt: mount . c i f s // f s 0 1 . example . com/ s h a r e mount_point 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. • To mount the share during boot place an entry in /etc/fstab, for example: / / 1 9 2 . 1 6 8 . 0 . 5 / s h a r e /mnt/ windows c i f s auto , username=s t e v e , password=s e c r e t , rw 0 0 • Another way to copy files from a Windows server is to use the smbclient utility. To list the files in a Windows share: s m b c l i e n t // f s 0 1 . example . com/ s h a r e −k −c ” l s ” • To copy a file from the share, enter: s m b c l i e n t // f s 0 1 . example . com/ s h a r e −k −c ” g e t f i l e . t x t ” This will copy the file . txt into the current directory. 137 • And to copy a file to the share: s m b c l i e n t // f s 0 1 . example . com/ s h a r e −k −c ” put / e t c / h o s t s h o s t s ” 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: s m b c l i e n t // f s 0 1 . example . com/ s h a r e −k Note 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. Resources For more smbclient options see the man page: man smbclient, also available online. The mount.cifs man page is also useful for more detailed information. The Ubuntu Wiki Samba page. Download 1.23 Mb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling