Change SMB login from guest to another user?

6,838

To answer your first question:

I think not. The reason it's not supported is simply that whoever made SMB didn't bother to add such support. However, as a workaround, just use multiple credentials, as you've thought of.

To address your second question:

No. You quoted the computer telling you that you can't do this.

"Trying to use net use \server\share /u:user will however fail saying multiple connections using more than one user name are not allowed."

However, I suspect you may be able to use another share. Just create a new shared folder, pointing to the same spot. (Use fsmgmt.msc as that interface will let you create a share. From the command line, type: "start fsmgmt.msc".) Or, from the client, try just visiting \server\c$ or \server\d$ or whatever the appropriate place is. (If you run fsmgmt.msc on the server, you can see where the appropriate place is.)

A share being used, but "net use" not seeing it, sounds weird to me. Although, in theory I suppose a program could contain an embedded SMB client instead of using Windows's, which would cause "net use" to not see it (on the client). Still, the server should report it using "net session".

Share:
6,838

Related videos on Youtube

Fraggle
Author by

Fraggle

Updated on September 18, 2022

Comments

  • Fraggle
    Fraggle over 1 year

    I have a file server (using Samba 4 if that's important) that I normally connect to as a guest with read-only access. Rarely, I want to alter its contents so I have to login as a different user. There are two issues with this.

    1) I'd like to do this without having to disconnect from the share. That is, I'd like to do something analogous to the Unix su command. Is there such a facility in the SMB protocol?

    2) net use doesn't seem to know when I've connected to the share (by running a program that accesses it). It reports "There are no entries in the list", neither can I use net use \\server\share /delete ("The network connection could not be found"). Trying to use net use \\server\share /u:user will however fail saying multiple connections using more than one user name are not allowed. Is there are any way to force a disconnection of an implicit guest connection short of closing every program using that connection?

  • Fraggle
    Fraggle over 6 years
    Although, in theory I suppose a program could contain an embedded SMB client instead of using Windows's, which would cause "net use" to not see it (on the client). Still, the server should report it using "net session". Having a Windows Explorer window open is sufficient to prevent the new login from working, so I think it's a more fundamental issue.
  • Fraggle
    Fraggle over 6 years
    However, I suspect you may be able to use another share. Just create a new shared folder, pointing to the same spot. I've tried connecting to other shares on the same server (that point to different folders) and get the same response, so it looks like I can't make any new connections.
  • Fraggle
    Fraggle over 6 years
    I'll have a go at this and see how I get on.
  • TOOGAM
    TOOGAM over 6 years
    Would it be easier to just use "runas" to create a faulty network connection, rather than needing to either log out, or to obtain source code, compile, and run an executable file that isn't installed by default?
  • TOOGAM
    TOOGAM over 6 years
    I have no answers for you yet. In Unix, I've found that SMB clients have two quite distinct commands for listing shared resources and for using shared folders. Seeing the list of shares might help discussions? Have you been able to connect, as desired, from a Unix system (which might help to isolate the problem to the Windows 10 client, rather than an uncooperative server)? I see last time it took over 13 months for a follow-up. Though we're still in January, maybe I can look forward to another response next year :)
  • Fraggle
    Fraggle about 6 years
    It's not quite 13 months, but it'll have to do! ;-)
  • Fraggle
    Fraggle about 6 years
    This didn't help, unfortunately. CancelConnection gives the same error that no connection exists, and AddConnection complains that you can't have multiple connections with different user names. I'm concluding that this is a basic 'feature' of the implementation.
  • Fraggle
    Fraggle about 6 years
    I've been attempting, unsuccessfully, to get Ubuntu to make an implicit guest connection. Whatever I've tried, it always brings up a dialog to make the connection. So I've come to the conclusion that the way they avoid the problem is to simply never make an implicit connection. As I've exhausted all suggestions, I'm going to accept this answer, as the answer appears to basically be "No and no!"