Re: [Samba] Get logged on username (several sessions on the same machine)
I'm aware that the fact connections aren't while the should is a client issue (let's say due to a finger press on the reset switch). I also know that it can possible that multiple users have a session open from the same machine (let's say a Linux box where Alice and Bob are connected with SSH and where they "smbmount" some ressources on a Samba Server). I now understand that there is no really a way to do what I want only with Samba, and that this is due to pure logic and SMB/CIFS specifications (if I'm wrong, please correct me). root preexec option in [netlogon] resource definition helps me now to get the real name of the connected user (since in my case only one person can use a workstation). Note that I see more than one execution of "root preexec" in one logon, as if client opens/closes/opens/closes/opens "netlogon" share from 2 to 4 times in its logon procedure... Thanks for your answer, cheers. K. Douglas VanLeuven wrote : Kurthermal wrote: But the machine has been rebooted and another user has opened a session on it, but 'net status session' or 'net session' continue to claim that there are 2 users logged on the same machine. It isn't always the case, I think it can be due for example to a reset of the machine so windows didn't close cleanly the network resources. I'm sorry I wasn't clear enough. I wasn't attempting to explain your circumstance. I was trying to state a general design principal using a kind of Socratic method. Windows workstations are notorious for not bothering to signal goodbye. There are MS KB articles about fine tuning Windows servers to avoid exhausting resources because the workstations are like that. It's not a samba issue, it's a windows issue. I only tried to explain why it is the way it is because you used the bug word. There has been a samba option for forever (since at least 1.x or beta) deadtime = just so the sessions don't hang around forever. I never tried setting it to 1 min., but you could experiment. But it doesn't work if an application forgets to close a file or release a lock.. I never tried it, but it should be possible to script something with the "root preexec" if this is really an issue for you. But be warned - there are legitimate reasons multiple users can be logged on to a samba machine at the same time. For example. My wife is logged on a widows machine. I connect with remote desktop. Samba version 3.0.28-0.1.95-1624-SUSE-SL10.3 PID Username Group Machine --- 7207 ranger1$ machine 192.168.202.35 (192.168.202.35) 7207 FOREST\doug users 192.168.202.35 (192.168.202.35) 7339 FOREST\cindy users 192.168.202.35 (192.168.202.35) 7207 FOREST\cindy users 192.168.202.35 (192.168.202.35) 7339 ranger1$ machine 192.168.202.35 (192.168.202.35) There's nothing I know of to readily distinguish your circumstance from this circumstance other than quiescence on the connection for a period of time. Doug Is there a way to get samba close all connections from a machine if another user try to open a new network resource from that machine ? Or is there another way to get the currently active session on a PDC client ? Douglas VanLeuven wrote : Kurthermal wrote: Am I the only one to have noticed this behaviour ? Do I have to report a bug or so ? Where can I get some answers ? If a service was running as a prior user and needed network resources from the samba server in addition to the currently logged on user, wouldn't it be wrong to make the assumption those resources should no longer be available? It only takes one exception to break a general case. Regards, Doug -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] Get logged on username (several sessions on the same machine)
But the machine has been rebooted and another user has opened a session on it, but 'net status session' or 'net session' continue to claim that there are 2 users logged on the same machine. It isn't always the case, I think it can be due for example to a reset of the machine so windows didn't close cleanly the network resources. Is there a way to get samba close all connections from a machine if another user try to open a new network resource from that machine ? Or is there another way to get the currently active session on a PDC client ? Douglas VanLeuven wrote : Kurthermal wrote: Am I the only one to have noticed this behaviour ? Do I have to report a bug or so ? Where can I get some answers ? If a service was running as a prior user and needed network resources from the samba server in addition to the currently logged on user, wouldn't it be wrong to make the assumption those resources should no longer be available? It only takes one exception to break a general case. Regards, Doug -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] Get logged on username (several sessions on the same machine)
Am I the only one to have noticed this behaviour ? Do I have to report a bug or so ? Where can I get some answers ? Kurthermal wrote : Maybe there is a way to tell samba to close previous session when a different login is used from the same computer ? Kurthermal wrote : Yes, I want to get currently logged on users at any time. Ryan Novosielski wrote : -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 What do you want it for? You can get that at login time by causing a script to write out the value of %U. Do you want a "right now" snapshot? Kurthermal wrote: I repost my question because I've noticed it on several Samba servers and I'm sure it is certainly a known problem. My configuration : Samba 3.0.24 Ubuntu Feisty Any help will be highly appreciated. Kurt Kurthermal wrote : Hello, I'm writting an application that will be running on a Samba PDC. It has to get (%username%) currently logged on some windows NT domain clients. I began to use 'net status sessions' but sometimes it returns more than one user currently logged on the same windows client. What's happening ? Is there a solution to avoid this ? Are there other methods to get ? Thanks, K. -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] Get logged on username (several sessions on the same machine)
Maybe there is a way to tell samba to close previous session when a different login is used from the same computer ? Kurthermal wrote : Yes, I want to get currently logged on users at any time. Ryan Novosielski wrote : -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 What do you want it for? You can get that at login time by causing a script to write out the value of %U. Do you want a "right now" snapshot? Kurthermal wrote: I repost my question because I've noticed it on several Samba servers and I'm sure it is certainly a known problem. My configuration : Samba 3.0.24 Ubuntu Feisty Any help will be highly appreciated. Kurt Kurthermal wrote : Hello, I'm writting an application that will be running on a Samba PDC. It has to get (%username%) currently logged on some windows NT domain clients. I began to use 'net status sessions' but sometimes it returns more than one user currently logged on the same windows client. What's happening ? Is there a solution to avoid this ? Are there other methods to get ? Thanks, K. -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] Get logged on username (several sessions on the same machine)
Yes, I want to get currently logged on users at any time. Ryan Novosielski a écrit : -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 What do you want it for? You can get that at login time by causing a script to write out the value of %U. Do you want a "right now" snapshot? Kurthermal wrote: I repost my question because I've noticed it on several Samba servers and I'm sure it is certainly a known problem. My configuration : Samba 3.0.24 Ubuntu Feisty Any help will be highly appreciated. Kurt Kurthermal wrote : Hello, I'm writting an application that will be running on a Samba PDC. It has to get (%username%) currently logged on some windows NT domain clients. I began to use 'net status sessions' but sometimes it returns more than one user currently logged on the same windows client. What's happening ? Is there a solution to avoid this ? Are there other methods to get ? Thanks, K. - -- _ _ _ _ ___ _ _ _ |Y#| | | |\/| | \ |\ | | |Ryan Novosielski - Systems Programmer II |$&| |__| | | |__/ | \| _| |[EMAIL PROTECTED] - 973/972.0922 (2-0922) \__/ Univ. of Med. and Dent.|IST/AST - NJMS Medical Science Bldg - C630 -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFH1XVmmb+gadEcsb4RApxbAJsE1VaZ+VUcgp2sQqyNx1YrL8NHXwCfYRbs PwDz2WcQu6EeAfD5QJPQvzg= =MZpJ -END PGP SIGNATURE- -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
Re: [Samba] Get logged on username (several sessions on the same machine)
I repost my question because I've noticed it on several Samba servers and I'm sure it is certainly a known problem. My configuration : Samba 3.0.24 Ubuntu Feisty Any help will be highly appreciated. Kurt Kurthermal wrote : Hello, I'm writting an application that will be running on a Samba PDC. It has to get (%username%) currently logged on some windows NT domain clients. I began to use 'net status sessions' but sometimes it returns more than one user currently logged on the same windows client. What's happening ? Is there a solution to avoid this ? Are there other methods to get ? Thanks, K. -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba
[Samba] Get logged on username
Hello, I'm writting an application that will be running on a Samba PDC. It has to get (%username%) currently logged on some windows NT domain clients. I began to use 'net status sessions' but sometimes it returns more than one user currently logged on the same windows client. What's happening ? Is there a solution to avoid this ? Are there other methods to get ? Thanks, K. -- To unsubscribe from this list go to the following URL and read the instructions: https://lists.samba.org/mailman/listinfo/samba