# Samba share in /etc/fstab is troubling a noob.

## TobiWan

Hi there,

I am not familiar with /etc/fstab entries concerning Samba entries. Is it possible and if yes, what does such an entry look like when I want to have the following:

I want to create a link on my KDE desktop with a nice harddrive icon that uses this entry from fstab. I want every normal user to be able to mount or umount the thing like a CD or DVD. Is this possible?

The share is a normal Windows 98 share (share level security) and has a password (no user attached).

thanks for a little pointer,

Tobias

----------

## Voltago

In my fstab there's an entry like this which can be mounted by users

```
//smbserver/smbfolder   /mnt/smbfolder    smbfs    guest,ro,noauto,user,gid=users,umask=0002
```

The samba user used to login remotely is 'Guest' however, and the share is mounted read-only. Hope that helps.

----------

## TobiWan

```
\\bespin\pocketboy  /mnt/pocketboy  smbfs  user,password=xyz,uid=1000,noauto  0  0
```

This works great for me. Thanks  :Smile: 

Though I cannot add another device link icon to my KDE desktop. KDE doesn't seem to accept the fstab entry when it isn't associated with a /dev entry.

Isn't there a possibility or a way to add a mountable icon just like a CD drive on the KDE desktop for Samba shares?

regards,

Tobias

----------

## mvbv-linux

Hi,

I want to automatically mount a win xp share protected with a password...

Where should I specify the password...I guess in /etc/fstab..but I don't want normal users to see it and they do have read access to /etc/fstab.

How can I achive this ?

----------

## Voltago

Create a text file that looks like this

```
username = <username>

password = <password>

```

and place it to a protected directory (let's say the file is '/root/smbcred'). Now add to your mount options

```
credentials=/root/smbcred
```

For more info on mounting a smb share, type

```
man smbmount
```

Bye!

----------

## mvbv-linux

Thanks...I had a look into the man smbmount, and indeed, it is explained very clearly   :Embarassed: 

----------

## Grik

I am not able to mount my samba shares with the /etc/fstab file.

For example, I can mount a share like this:

```
mount -t smbfs -o username=rik //10.0.0.8/Riksdir /home/rik/smb

Password:
```

Now I can browse my samba share like it is a directory on my PC.

But I don't want to type this mount command every time, I want to place it in my /etc/fstab. I tried several different lines, but they all don't work! Examples:

```
//10.0.0.8/Riksdir      /home/rik/smb   smbfs   noauto,user,uid=1000,gid=100,credentials=/home/smb_rik  0 0

```

```
//10.0.0.8/Riksdir      /home/rik/smb   smbfs   uid=1000,gid=100,credentials=/root/smb_rik      0 0

```

/root/smb_rik contains:

```
username = rik

password = mypassword
```

And has read rights 400 for root:root (I tried other files on other locations with other permissions, like 777).

...Help?

----------

