LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   permanent smb mount with option guest (https://www.linuxquestions.org/questions/linux-newbie-8/permanent-smb-mount-with-option-guest-4175598074/)

chtsalid 01-23-2017 12:56 PM

permanent smb mount with option guest
 
Hi,

I try to mount an smb with option guest using the fstab, but I receive an error. However using the mount.cifs command it mounts.

[root@rh2 ~]# mount.cifs //192.168.122.1/anonymous /mnt/smb -o guest
[root@rh2 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 7.6G 4.4G 3.3G 58% /
devtmpfs 905M 0 905M 0% /dev
tmpfs 920M 0 920M 0% /dev/shm
tmpfs 920M 8.8M 912M 1% /run
tmpfs 920M 0 920M 0% /sys/fs/cgroup
/dev/vda1 497M 213M 285M 43% /boot
192.168.122.1:/var/nfs 39G 11G 29G 27% /mnt/nfs
tmpfs 184M 0 184M 0% /run/user/0
//192.168.122.1/anonymous 39G 11G 29G 27% /mnt/smb
[root@rh2 ~]# umount /mnt/smb/


vi /etc/fstab
//192.168.122.1/anonymous /mnt/smb cifs guest defaults 0 0

ount: /etc/fstab: parse error: ignore entry at line 13.

any idea?

Many thanks!

eSelix 01-23-2017 01:24 PM

You have space between "guest" and "defaults". Maybe just remove option "defaults".

chtsalid 01-23-2017 01:29 PM

Hi,

[root@rh2 ~]# mount -a
[root@rh2 ~]#
[root@rh2 ~]#
[root@rh2 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 7.6G 4.4G 3.3G 58% /
devtmpfs 905M 0 905M 0% /dev
tmpfs 920M 0 920M 0% /dev/shm
tmpfs 920M 8.8M 912M 1% /run
tmpfs 920M 0 920M 0% /sys/fs/cgroup
/dev/vda1 497M 213M 285M 43% /boot
192.168.122.1:/var/nfs 39G 11G 29G 27% /mnt/nfs
tmpfs 184M 0 184M 0% /run/user/0
//192.168.122.1/anonymous 39G 11G 29G 27% /mnt/smb


many thanks!


All times are GMT -5. The time now is 06:51 PM.