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
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.