LX0-104 · Question #572
Which of the following commands will mount a remote Samba share when the user is Winuser and the password is somepass?
The correct answer is A. mount -t smbfs -o username=Winuser,password=somepass //SERVER/share /media/sambashare. To mount a remote Samba share, the mount command with cifs (or smbfs) type is used, specifying the username and password with the -o option and the share path in the //SERVER/share format.
Question
Options
- Amount -t smbfs -o username=Winuser,password=somepass //SERVER/share /media/sambashare
- Bmount -t smbfs -o username=Winuser,password=somepass \SERVER\share /media/sambashare
- Cmount -t smbfs -o Winuser%somepass //SERVER/share /media/sambashare
- Dmount -t smbfs -o username=Winuser%somepass //SERVER/share /media/sambashare
How the community answered
(18 responses)- A94% (17)
- D6% (1)
Why each option
To mount a remote Samba share, the `mount` command with `cifs` (or `smbfs`) type is used, specifying the username and password with the `-o` option and the share path in the `//SERVER/share` format.
The correct syntax for mounting a CIFS (Samba) share in Linux involves using `mount -t cifs` (or `smbfs` for older systems), specifying authentication credentials via `username=Winuser,password=somepass` within the `-o` option, and providing the remote share path in the `//SERVER/share` format followed by the local mount point. This command correctly uses standard Linux `mount` options for CIFS/SMB shares.
While the `-o username=Winuser,password=somepass` part is correct, the `\\SERVER\share` path uses Windows-style backslashes which are typically not correctly interpreted by the Linux `mount` command for remote CIFS/SMB paths; forward slashes are required.
The `-o Winuser%somepass` syntax is incorrect for specifying username and password with `mount -t smbfs`; the correct format uses `username=` and `password=`.
The `-o username=Winuser%somepass` syntax combines the username and password incorrectly within the `username` option; they should be separated by a comma and specified with `username=` and `password=`.
Concept tested: Mounting CIFS/Samba shares in Linux
Source: https://linux.die.net/man/8/mount.cifs
Topics
Community Discussion
No community discussion yet for this question.