OS: Linux (Debian 8) Environment details:
- We use LXDE and
uxterm
. - Virtual console form till ctrl +Alt + F6 is disabled.
- Total users available user1, user2, user3
the default system is set with auto login with user1 and we trigger user terminal via script (uxterm
).
On user pressing special combination in LXDE it invoked a Uxterminal in screen with User2 as login. on login success, user2 console can be used.
We have 3rd user, where his role is very limited and needed for our current scenario of our operation.
To create a BASH profile for the user, we have added info in sudoers
with NOPASSWD
option.
etc/sudoers
User_Alias PRIVILEGEDUSER = user1,user2
Runas_Alias TARGETUSER = user2,user3
PRIVILEGEDUSER ALL=(TARGETUSER) NOPASSWD: /bin/bash
also we have added env_keep
in Defaults
Defaults env_reset
Defaults env_keep += "JRE_HOME"
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
With this option when we try switching user, JRE_HOME
is not getting set. Also added JRE_HOME in etc/.profile
manually for all available users in system for testing purposed, even that did not help
JRE_HOME=/usr/lib/jvm/java-7-openjdk-i386/jre
export JRE_HOME
Need some guidance in setting JRE_HOME
during sudo -u
switching.