Questions tagged [switch-user]
44 questions
7
votes
2 answers
Dockerfile entrypoint unable to switch user
I am unable to switch user to a non-root user from the entry point script. The User directive to change the user in Dockerfile works, but I am not able to change permissions using chmod. To overcome this issue I created entrypoint.sh script to…

Faizan
- 181
- 1
- 1
- 11
7
votes
1 answer
How to switch current user using powershell?
my task is to create new windows local user, log in, using it and then do some actions. Creating new user wasn't a problem but i don't know how to switch current user to new one.
What i did is a piece of script which start new powershell window…

Pafcio
- 71
- 1
- 1
- 4
5
votes
1 answer
unable to detect application running with another user (via switch user)
Use case: I login as "user1" and launch Safari, then I click "user1" on top-right corner and switch user to "user2".
Now, I am trying to detect whether Safari is running for "user1" but I am unable to do so with standard calls. I am using OS X 10.8…

dDarkLORD
- 624
- 7
- 25
4
votes
1 answer
Detect switch user with powershell
I want to register the date and time of each time switch user is invoked in a machine. How can I do that? Something similar to this but for the "switch user" event: detect log off and on with powershell
Thank you in advance

Artur Carvalho
- 6,901
- 10
- 76
- 105
4
votes
1 answer
unable to switch back user using switch user gem rails
I am using the switch_user gem This question has almost the exact problem that I have. I have tried the same thing as in the question and like the readme says. This the code I have tried.
config.controller_guard = { |current_user, request,…

Aravind
- 1,391
- 1
- 16
- 41
3
votes
1 answer
Authentication handler not called while switching user
I have a basic form-login authentication in my app, and I set up a handler using AuthenticationHandlerInterface, in which I'm setting session vars in the onAuthenticationSuccess() method.
The problem is that when I switch to another user (using…

Yoot
- 657
- 2
- 14
- 26
2
votes
0 answers
grep: /proc/version : Permission Denied
I wanted to run vscode as non root user so I switched to another user by "su - username"
and run "code" but it gave an error "grep : /proc/version : permission denied"
Help me out !!!

Onkar Gupta
- 31
- 2
2
votes
0 answers
Run CGSession -switchToUserID on remote Mac
I have next script on my remote Mac:
on run
do shell script "/System/Library/CoreServices/Menu\\ Extras/User.menu/Contents/Resources/CGSession -switchToUserID 502"
delay 5
tell application "System Events"
keystroke "mypassword" &…

Rougher
- 834
- 5
- 19
- 46
2
votes
0 answers
Windows Authentication Logout / SigninwithDifferent User
I am using windows authentication in ASP.NET MVC.
I want to Logout? So I researched and found the following
The code is based on decompiling the Microsoft.TeamFoundation.WebAccess which has the "Sign in as a different User" function.
public…

Taha Naqvi
- 1,756
- 14
- 24
2
votes
1 answer
Show Windows' user switching screen
I want to do (programmatically, using WinAPI) exactly the same what Windows does when you click on 'Switch User' in the Start Menu. Namely, to show the screen where all available user accounts are listed and you can switch to another account still…

noober
- 4,819
- 12
- 49
- 85
2
votes
1 answer
Trying to detect a windows user switch and close a serial port
I have a application I wrote that uses a serial port (hand scanner connected to it) and I need to detect somehow that another user switched so I can close that port and when the new user logs on to the application it wont get 'port in use' error. …

skifreak
- 43
- 9
2
votes
0 answers
Switching User , SSH'ing into remote machine and executing command on one line. ('unknown': unknown terminal type.)
This command use to work on RHEL5.8, however since we upgraded to 6.5 (bash version 4.1.2) it started outputting the following: 'unknown': unknown terminal type.
sudo su - *user* -c "ssh *remoteserver* 'sudo /etc/init.d/server1.sh…

Motorahead
- 75
- 1
- 6
2
votes
1 answer
How do you Switch User?
We're upgrading some work PC's to Windows 8, so for those users that fear change I've written a small helper app to help them log off (to keep them away from Metro, where possible).
The app works just fine except that I cannot find out how to Switch…

David Gard
- 11,225
- 36
- 115
- 227
2
votes
2 answers
Rails: Switch User Gem and issues with switching back to original user
In my app I am using the switch_user (https://github.com/flyerhzm/switch_user) gem to allow admins to login as another user. The gem has the ability to log back in as an admin, but I am having a hard time conceptualizing how to do it.
Here is my…

dennismonsewicz
- 25,132
- 33
- 116
- 189
2
votes
2 answers
After COM API call, getting EOSError Exceptions (access denied) but only when switching users or Locking the station on Windows 7
I have a Delphi 6 application that is getting an EOSError Exception, code 5, access denied but only when I switch away to another Windows 7 user account, or I Lock the station. I am printing out a stack trace but the error appears to be coming…

Robert Oschler
- 14,153
- 18
- 94
- 227