Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:guides:samba [2013/04/28 19:00] – [How does it work?] emgi | en:guides:samba [2013/04/30 20:12] (current) – linea | ||
|---|---|---|---|
| Line 18: | Line 18: | ||
| Enter User's password: **** | Enter User's password: **** | ||
| </ | </ | ||
| - | This will provide a list of the shares available on the machine called | + | This will provide a list of the shares available on \\nas. The result should look similar to the example below: |
| < | < | ||
| Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.3-31a.osstech] | Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.3-31a.osstech] | ||
| Line 39: | Line 39: | ||
| # | # | ||
| </ | </ | ||
| - | Although not strictly required, it is recommended to add the server name to /etc/hosts for name resolution when it has a fixed ip address. Because we are running on Linux we need to ' | + | From the above example, we are interested in access to Sharename ' |
| < | < | ||
| # smbclient \\\\nas\\share | # smbclient \\\\nas\\share | ||
| Line 45: | Line 45: | ||
| smb: \> | smb: \> | ||
| </ | </ | ||
| - | At this prompt you can issue ftp-style commands to browse the file system and read/write files. | + | At the prompt you can issue ftp-style commands to browse the file system and read/write files. |
| + | < | ||
| + | smb: \> help | ||
| + | ? allinfo | ||
| + | cancel | ||
| + | close del dir du | ||
| + | exit | ||
| + | history | ||
| + | lowercase | ||
| + | mget | ||
| + | open | ||
| + | posix_rmdir | ||
| + | pwd q queue quit | ||
| + | rd | ||
| + | rm | ||
| + | symlink | ||
| + | volume | ||
| + | showconnect | ||
| + | smb: \> quit | ||
| + | # | ||
| + | </ | ||
| Fortunately you can also access a Windows share by mounting it on your box like this: | Fortunately you can also access a Windows share by mounting it on your box like this: | ||
| Line 66: | Line 86: | ||
| # | # | ||
| </ | </ | ||
| - | If there is no access-denied-message in reply to the password, it means the share is mounted and can be accesssed | + | If there is no access-denied-message in reply to the password, it means the share is mounted and can be accessed |
| <note tip>The password must be the admin password for your storage device. This may not work when you have enabled user-based security. In some cases the mount may be read-only. </ | <note tip>The password must be the admin password for your storage device. This may not work when you have enabled user-based security. In some cases the mount may be read-only. </ | ||
| Many of the problems with Samba are caused by a lack of understanding the Windows security mechanism. In its basic version, which is still used most of the time, this is user-based security so you will need a **valid windows user account** to access the file share. When in trouble, verify the access is working from a windows machine and use the same credentials under Linux. | Many of the problems with Samba are caused by a lack of understanding the Windows security mechanism. In its basic version, which is still used most of the time, this is user-based security so you will need a **valid windows user account** to access the file share. When in trouble, verify the access is working from a windows machine and use the same credentials under Linux. | ||
| Line 80: | Line 100: | ||
| The procedure to add a user to your samba server: | The procedure to add a user to your samba server: | ||
| - | < | ||
| - | [a] First add Linux user using the adduser command. | ||
| - | [b] Then add the same user name to Samba using: | + | First add Linux user using the adduser command. |
| + | < | ||
| + | Changing password for smbuser01 | ||
| + | New password: | ||
| + | Retype password: | ||
| + | Password for smbuser01 changed by root | ||
| + | </ | ||
| - | Use: smbpasswd --help to view the options. | + | Then add the same user name to Samba using: smbpasswd -a |
| + | < | ||
| + | # smbpasswd | ||
| + | New SMB password: | ||
| + | Retype new SMB password: | ||
| + | Added user smbuser01. | ||
| + | # | ||
| </ | </ | ||
| + | Use: smbpasswd -h to view the options. | ||
| The file shares and printers you want to allow your Windows clients access to can be defined in the Samba configuration file which is: **/ | The file shares and printers you want to allow your Windows clients access to can be defined in the Samba configuration file which is: **/ | ||