SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi - I am trying to use smb to access my work server from linux. I can create the share and get read access but am having issues with the write/modify access. I can save or create a new file but I can not modify. I am creating the share using my windows AD credentials (user name, domain and pw) which works fine. Are there parameters within smb mount that allow me to access these network drives and files using the AD user account or will I always be using my linux user for access as this is where the mount is created from. It is a work network server so I really do not want to mess around with permissions on the AD side but would consider possibly if that was the only route.
I did try setting up the smb mount using my linux user gid and uid but that did not seem to work either.
So I guess my question is where is the write/modify security set - in the smb mount command and if so what parameters should I be using or at the AD level in which case what would need to be done there.
Are there parameters within smb mount that allow me to access these network drives and files using the AD user account or will I always be using my linux user for access as this is where the mount is created from.
Generally speaking, whenever you try to access a service, you need to use the credentials attached to that service.
On your Linux machine, you would need to use your Windows credentials to mount the Windows share. The capabilities of Linux will be limited to your user's permissions in Windows.
The way I'd do this for an ad-hoc connection is as per the instructions given by Henrik above, but slightly modified (as root):
Code:
# mount -t cifs -o username=MYUSERNAME,password=MYPASSWORD //192.168.x.x/FILESHARE_NAME /mnt/MOUNTPOINT
Note that the options (the part after "-o") are comma separated with no spaces. You could add ",ro" to the options if you want read-only access to the share.
RW access will depend upon your permissions in Windows.
If you wanted to make it happen automatically on boot (provided the machines are on the same LAN), you can add a line like the following to /etc/fstab:
Hi - my mount seems to be working ok - it seems to be a file rights issue. When I try to modify from Linux side (even though mounted using my AD creds) it prevents me from making any changes to a file. Even as root - trying to change a file using vi I get error Error: test1: Permission denied; test1: WARNING: FILE TRUNCATED and a {file}.part is created and both the original {file} and {file}.part are corrupt and unreadable. I can create a new file but can not modify once created.
These are all examples of file on the hare after I created the test# file and then try modifying using vi. Both the original and .part file are corrupt/unreadable after I attempt to save changes in vi.
-rwxr-xr-x 1 root root 0 Jun 27 17:53 test1
-rwxr-xr-x 1 root root 373 Jun 26 15:16 test1.part
-rwxr-xr-x 1 root root 0 Jun 26 15:18 test2
-rwxr-xr-x 1 root root 7 Jun 26 15:17 test2.part
-rwxr-xr-x 1 root root 2 Jun 26 15:25 test3
-rwxr-xr-x 1 root root 7 Jun 26 15:30 test3.part
Thank you for sharing that link. I have tried all the iterations and though I can create the mount and see the mounted drive - I am unable to modify files. If I use my windows machine to access the same thing I type \\server\share into the file browser where it then asks me for my network credentials. Everything I do then on the server is logged as that AD user even though my windows laptop is not on the domain and is not using a domain user. The only domain creds are when I access the server. I am thinking this is the same concept that I am trying to do from my linux machine but the rights issue is still problem.
To add some details the server I am connecting to is windows server 2019; my laptop is Slackware 15 (not current)
Have you created a .smbcredentials file in your home directory?
I mount my windows shares (using CIFS) to servers in an AD domain to a directory, home/network. I also have my .smbcredentials file stored in that network directory. The .smbcredentials file is very simple. It contains:
I have tried all variants of the mount - here is the one I believe should work - I enter the AD password when it tries to connect. I have tried the creds file too. In all cases I can connect and browse but not write. Are the write issues on the server side or my linux user? Could be my naivete in thinking that everything on the server side should be tied to the AD user to which I am creating the share? Perahsp this is the wrong thinking?
A bit more to share. I get the same write issues using Dolphin smb mount. Again connects fine, reads fine but no write. I wonder if there is something on the Microsost server side I need to enable? but again, I can connect using a non-AD windows laptop, and r/w just fine using the same smb:\\ mount and AD user creds.
However, losing patience with this matter, I pulled out an old workstation that has slack-current on it. That works exactly as expected! Why would Slack 15 not work and current would? How would I go about troubleshooting this - simply try re-installing 15 on the laptop I was having issues with?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.