Windows 7 can't connect to samba share on Linux

14,819

See if the following works

net use x: "\\\\servername\sharename" /user:username@domainname /persistent:no

replacing all terms that end in name with the appropriate value and x with the drive letter you want

Use

net use /d x:

to disconnect

Share:
14,819

Related videos on Youtube

Devolus
Author by

Devolus

Updated on September 18, 2022

Comments

  • Devolus
    Devolus over 1 year

    I have three machines with Windows 7. Two of them can connect to my Linux server which is hosting a SMB share, while the third can't. I don't understand why this happens, because I connected once, and a few days later it doesn't work anymore.

    When I try to go the linux machine, it asks me for a username password. On this W7 machine I intentionally left it like this, because I don't want it to store the connection. But for some reason it no longer connects. I can see the shares in the browser, but when I try to enter into it, then I can't seem to get by the password dialog. The connection definitely works, because I can connect via SSH, and on the other two machines the same shares are used as well. The only difference is that there, I have mapped the drives to a letter and it autoconnects when logging in.

    So I would appreciate any tips what I should look for, because I don't really know where to start at the moment.

    UPDATE

    The machine in question is my company laptop. When I'm connected to my company domain this doesn't work. I also tried to enter the domain used in the smb.conf file, but that doesn't seem to help either. I get an access denied error. I tested this now and when I reboot and login to this machine, then I can connect to my linux server without any problems, I don't even need to specify the domain. As soon as I'm connecting to my company this doesn't work, and even if I logout from it, it will not work until I reboot.

    So is there some policy involved that needs to be changed?

    • Kevin
      Kevin over 10 years
      Have you tried Net Use
  • Devolus
    Devolus over 10 years
    That doesn't work, but at least I realised something which may be important. The machine I'm ytring to connect from is in a different domain because it's my company laptop. So how can I switch domain, resp which domainname do I have to use? I'm not aware that I configured a domain on my other machines.
  • Kevin
    Kevin over 10 years
    I would use the domain/workgroup of your Linux server
  • Kevin
    Kevin over 10 years
    for domainname in the net use command use the workgroup name from your /etc/samba/smb.conf file
  • Devolus
    Devolus over 10 years
    I updated my question with additional info. Adding the domain doesn't seem to help, only after a reboot it works as long as I don't connect to my company network.
  • Devolus
    Devolus over 10 years
    I accepted your answer because technically it would be correct, but you couldn't know about the specific circumstances and I didn't know them at the time. So your answer at least pointed me in the right direction.