Labels

Android (1) Apache (1) bash (2) boost (2) C (37) C++ (5) cheatsheet (2) CLion (6) css (3) Debian (34) DL (17) dns (1) Docker (3) Dreamweaver (2) Eclipse (3) fail2ban (5) git (6) GitHub (5) Hacking (4) html (8) http (1) iOS (1) iPad (1) IRC (1) Java (33) javascript (3) Linux (184) Mac (21) Machine Learning (1) mySQL (53) Netbeans (6) Networking (1) Nexus (1) OpenVMS (6) Oracle (5) Pandas (3) php (17) Postgresql (8) Python (9) raid (1) RedHat (15) Samba (3) Slackware (52) SQL (14) ssh (1) svn (1) tar (1) ThinkPad (1) Virtualbox (4) Visual Basic (2) Visual Studio (1) Windows (8) wire (1)

Saturday, 5 September 2026

Mount Windows share in Linux

 Brief note on mounting a windows share in Slackware.



1) Create the mount point, for example /mnt/SHARE and change owner and group permissions applicable to the user needing access, example: drwx------  2 plisken users  48 Sep  5 09:41 SHARE-A/

2) Get the id of the user with id plisken as we will need it in the next step.

3) Mount it using the details from the above, for example:

sudo mount -t cifs //xx.xx.xx.xx/share-a /mnt/SHARE-A -o username=plisken,domain=.,uid=plisken,gid=users,file_mode=0700,dir_mode=0700

4) profit.

This can also be added to /etc/fstab

1) Do the following;

mkdir -p /etc/samba
vim /etc/samba/credentials-share-a

2) In the above file, add;

username=plisken
domain=domain_or_local_machine_name
password=YOUR_PASSWORD

3) Restrict permissions to root: chmod 600 /etc/samba/credentials-share-a

4) Add the below to /etc/fstab;

//xx.xx.xx.xx/SHARE-A  /mnt/SHARE-A  cifs  credentials=/etc/samba/credentials-share-a,uid=plisken,gid=users,rw,noperm,file_mode=0700,dir_mode=0700,_netdev  0  0

5) To test the above, unmount the share;

sudo umount /mnt/SHARE-A 
and then mount all;
sudo mount -a

To map such a share on a Windows machine...

net use H: \\xxx.xxx.xxx.xxx\share-name REMOTE-PASSWORD /USER:DOMAIN\user /PERSISTENT:YES

Where share-name is the name of the share on the remote machine.

Where REMOTE-PASSWORD is the password of the connecting user, which needs to have permissions on the remote machine.

Where DOMAIN\user is the full account name associated with the PASSWORD on the remote machine

Example:
net use H: \\xx.xxx.xx.xxx\share-a my_password /USER:MY-DOMAIN\my_username /PERSISTENT:YES

To delete this we would do net use H: /DELETE






No comments:

Post a Comment

Note: only a member of this blog may post a comment.