# Accessing a network smb share in linux

**URL:** <https://community.learnlinux.tv/t/accessing-a-network-smb-share-in-linux/1452>\
**Category:** Uncategorized\
**Created:** [March 10, 2022, 4:45am UTC](https://community.learnlinux.tv/t/accessing-a-network-smb-share-in-linux/1452 "2022-03-10T04:45:08Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![ThatGuyB](https://community.learnlinux.tv/user_avatar/community.learnlinux.tv/thatguyb/32/784_2.png) [@ThatGuyB](https://community.learnlinux.tv/u/ThatGuyB)\
**Post date:** [March 10, 2022, 12:20pm UTC](https://community.learnlinux.tv/t/accessing-a-network-smb-share-in-linux/1452/3 "2022-03-10T12:20:37Z")

</div>

Welcome to the forum!

Check this out:

> [@Permission questions](https://community.learnlinux.tv/t/permission-questions/1450/2):
>
> If you’re using CIFS to mount the remote fs, you’ll want to give the login user and group as part of the mount command. For security,. you’d put the info in your ~/.smbcreds file and reference that from your mount command in /etc/fstab. So in /etc/fstab: \> //myserver.local/work /work cifs vers=2.1,credentials=/home/myuser/.smbcreds,uid=5001,gid=6000,iocharset=utf8,rw,file\_mode=0660,dir\_mode=0770 And in your ~myuser/.smbcreds: username=myuser password=mypassword workgroup=MYWORKGROUP …

You may want to try

```auto
//192.168.1.93/mnt/user/Media /mnt/Media cifs credentials=/home/user/.smbcreds,uid=1000,gid=1000,iocharset=utf8,rw,file_mode=0660,dir_mode=0770 0 0

```

You can find the UID and GID of your user by running `id user`. Usually the first user created starts at 1000.

It’s possible that the password may interfere with the mount. Also, it’s not secure to keep your password in a world-readable file, like fstab. Buffy described in the post I linked how to create the .smbcreds file. After you are done, `chmod 600 /home/user/.smbcreds` to make it readable and writable only by your user.

If it keeps giving you headaches, do as the mount command says and run `sudo dmesg | grep -i -e cifs -e smb`

---

_[View the full topic](https://community.learnlinux.tv/t/accessing-a-network-smb-share-in-linux/1452)._
