12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Samba File Sharing 317TABLE 13.2Continuedput mput promptlsexitUpload local file to the current remote directoryUpload multiple local files to the current remote directory; you willbe prompted for each matching file unless prompt is disabledToggle prompting confirmation for each file with mget and mputcommandsList files in current remote directoryClose connection to Samba server and exitMounting the Samba ShareTo mount a Samba share to a local directory similar to mounting an NFS share, use thefollowing command (you must be root):13mount -t cifs //servername/sharename /mountpoint -o username=Replace the servername, sharename, mountpoint, and username. You will be prompted forthe password. Remember that the user must exist as a Samba user on the Samba server.After it is mounted, the files on the mount can be accessed just like local files in the directorygiven as the mount point. All updates to the share automatically appear on theclients.To unmount the share, use the command umount /mointpoint (replace /mountpoint).This mount is not persistent—it will not be remounted on reboot.Alternatively, the mount.cifs command from the samba-client package can perform thesame mount. It is just a shortcut to mount -t cifs. It must be run as the root user as well:mount.cifs //servername/sharename /mountpoint -o username=To create a persistent mount that is automatically mounted at boot time, add an entry to/etc/fstab://servername/sharename /mountpoint cifs defaults 0 0Replace servername, sharename, and mountpoint. To make the mount read-write, replacedefaults with rw. Because including the password is a security risk, and just giving theusername will prompt for a password, this configuration mounts the share as a guest user.Because mounting as a guest only gives the user the permissions of user nobody on theSamba server, it is possible to configure a credentials file that includes the username andpassword (and any other options necessary for the mount)://servername/sharename /mountpoint cifs credentials=/etc/smbcreds 0 0This configuration will refer to the file /etc/smbcreds for Samba options. The file shouldinclude the following lines (replace and ):username=password=

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!