LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-29-2008, 01:26 PM   #1
manishgarg21
LQ Newbie
 
Registered: May 2008
Posts: 16

Rep: Reputation: 0
How to switch between users like windows


Hi,

Is it possible to have multiple users using the same linux box, and depend upon the requirement any user can switch to his/her session. Very much like Windows user switch. I heard it is available with KDE, is it available with GENOM also. If so, how to use it. Thanks in advance.

Manish.
 
Old 05-29-2008, 01:45 PM   #2
johnsfine
LQ Guru
 
Registered: Dec 2007
Distribution: Centos
Posts: 5,286

Rep: Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181Reputation: 1181
Quote:
Originally Posted by manishgarg21 View Post
Very much like Windows user switch. I heard it is available with KDE, is it available with GENOM also. If so, how to use it.
I'm not sitting at my Linux (Mepis) system at the moment, so I can't give you exact keystrokes or menu picks, but it is pretty obvious when you try it.

I also don't know if the easy convenient way that works on my system is entirely KDE or depends on something about the way the default Mepis install configures KDE.

It is in the menu system where you would expect it (near log out) and gives you two obvious choices for starting new sessions.

One way to start a new session is very much like Windows user switch and applies to the case where you want to switch actual users (but without closing open programs): When you want to switch back, you need to give the password of the user you are switching back to.

The other way creates the new session (KDE desktop logged in as a different user) without suspending the authentication of the current user for the current desktop. Then you have key combinations (If I remember correctly ctrl-Alt-F8 and ctrl-Alt-F9) for quick switches between the two desktops without retyping either password. That makes sense for one actual user using two user accounts at once. Configuring and using sudo properly would probably make more sense for using two user accounts at once, but using two sessions requires less expertise and less pre configuration.

Last edited by johnsfine; 05-29-2008 at 01:47 PM.
 
Old 05-29-2008, 01:54 PM   #3
Takla
Member
 
Registered: Aug 2006
Distribution: Debian
Posts: 188

Rep: Reputation: 33
In Gnome switching users is available from the shutdown menu and there is also a fast user switch applet.
 
Old 05-29-2008, 03:15 PM   #4
czarr
Member
 
Registered: Apr 2008
Distribution: Arch
Posts: 36

Rep: Reputation: 15
Linux was designed with multiple users in mind. Windows was not.
 
Old 05-29-2008, 03:36 PM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by czarr View Post
Linux was designed with multiple users in mind. Windows was not.
Indeed---I was going to make a wise-crack to the effect of: "Why would you want to go backwards to the way Windows does it?"

On Win2k, a user has to log out before another can log in. Are XP or Vista any different?
 
Old 05-29-2008, 03:51 PM   #6
Takla
Member
 
Registered: Aug 2006
Distribution: Debian
Posts: 188

Rep: Reputation: 33
Quote:
Originally Posted by pixellany View Post
Indeed---I was going to make a wise-crack to the effect of: "Why would you want to go backwards to the way Windows does it?"

On Win2k, a user has to log out before another can log in. Are XP or Vista any different?

Yes they are different, you can switch users without logging out.
 
Old 05-29-2008, 07:16 PM   #7
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
"On Win2k, a user has to log out before another can log in. Are XP or Vista any different?"

Yes, Microsoft has "innovated" and copied the *NIX community and essentially allows you to switch between virtual consoles running a desktop. They were a few years late, but I'm sure they've got the patents to prove that the *NIX community built a time machine to steal their ideas.

Other 'features' stolen by that "outdated" system called UNIX but which haven't been invented and patented by Microsoft yet include:
1. proper handling of time (UTC), with processes having their own timezones
2. multi-user (tens of users can connect simultaneously to the one machine and run software on that machine while displaying the result on their screens)
3. the virtual desktop such as the one KDE has had for quite a few years now
The list goes on and on of course - after all, UNIX is the most obsolete system on the planet.

Some 'features' of MS products which UNIX people are too stupid to be able to copy:
1. DRM
2. Spyware
3. Blue screen (and recently, 'Green screen' - just as the film and television industry invented 60 years ago)
4. defective drivers and codecs (will not play music, video, etc - but MS claims that the drivers do in fact work and it's just the 'DRM' because all MS clients are thieves and shouldn't be allowed to play video or audio)
Again, the list just goes on.

Anyway, as far as setting up those multiple consoles with X - 'google' is very useful for finding information. At various times, window managers have even come with tools to help you set them up (but I think the tools are often removed or disabled because they can be considered a security risk).
 
Old 05-29-2008, 07:22 PM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
It's really up to these two pieces:

1.- the display manager (kdm, gdm or whatever)
2.- the init system

I mean: gdm and kdm might have this functionality, and it should be obvious in the menus and/or the screensavers, I don't use this kind of thing so I can't test if for you. But, as long as you log in using kdm or gdm, either kde or gnome should allow you to do a quick user change.

Regarding (2): depending on the distro, multiple copies of k/gdm might be spawned at boot time, each one of them will let you login as a different user. This might or might not be set up beforehand depending on the distro, but if it's setup, you only need to use control+alt+(f7 to f12) to change from one vt to another (f1 to f6 are usually reserved for command line only logins).

Even if you use the first way, you can still use the second way to go back to the other user. For example, if you open a new user session from the first one, you should be able to go back to the other by using control+alt+f7, and again the new one with control+alt+f8, and so on.

Last edited by i92guboj; 05-29-2008 at 07:25 PM.
 
Old 05-29-2008, 08:26 PM   #9
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
This is what I do. My main home pc for doing everything has three user accounts. One is for general Internet activity. One is for my email. One is for personal stuff with no Internet access at all.

I log on to the account for general Internet access. Then I open a terminal window. In the terminal window I use the su command to switch user to the email account. I leave that process logged in. I then open another tab in the terminal window and use su to switch user to the personal data account. I leave the terminal window open always.

When I want to read email I maximize the terminal window, click on the session that is logged on to the email account and start kmail from the command line.

When I want to edit my personal data such as my resume I maximize the terminal window and click on the session that is logged on to the user account for personal data. I can start Open Office dot org software suite or gnucash from the command line.

Note that in most or all distributions the first time that you do this you have to tell your Internet account to allow X window applications from other users to display on your open X window virtual desktop device. You use the xhost command from the comnand line to do that. You may also be able to use kcontrol or gnome-control to set this up. I don't want to experiment with my current settings but I believe that the following command will work from the command line.

Code:
xhost +localhost:*.*
If your distribution allows root logins then don't use the xhost command when you are logged on as root. It's a little bit inconvenient at times when I'm logged on as root and want to run Firefox as a normal user but security is worth the slight inconvenience.

Also my login script for all users at the system level, (etc/bashrc.local or whatever), contains the line
Code:
export DISPLAY=":0.0"
Different distributions require that the line be included in different files. My PCLinuxOS system requires that I put that line in /etc/profile.d/aliases.sh. My Novell SuSE system required that I put that line in the /etc/bashrc.local file, which I had to create. You could put that line in each user account's $HOME/.bashrc or some other local file. I haven't figured it out for Ubuntu which I just recently starting using again after a long sabbatical from it. It all depends on your distribution. I have found that user login scripts is one area where different distributions vary widely.

Anyway the point is that I am logged on to all of my normal user accounts at one time and I can run applications from any/all of them simultaneously. The only common computer resource is the display so that is the only area where data could leak from one account to another if data is displayed on the screen. It's pretty secure. I know that some evil Java application cannot find my resume when I'm browsing the web because the resume is in another user account directory that cannot be read from the Internet user's account.

Try THAT in Windows! NOT!!!

Last edited by stress_junkie; 05-29-2008 at 08:46 PM.
 
Old 05-29-2008, 08:43 PM   #10
AceofSpades19
Senior Member
 
Registered: Feb 2007
Location: Chilliwack,BC.Canada
Distribution: Slackware64 -current
Posts: 2,079

Rep: Reputation: 58
In kde you just have to go kmenu>switch user, or at least in slackware's kde
 
Old 05-29-2008, 08:49 PM   #11
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
Quote:
Originally Posted by AceofSpades19 View Post
In kde you just have to go kmenu>switch user, or at least in slackware's kde
This is equivalent to Windows functionality and it IS what the OP asked for. It works in PCLinuxOS KDE as well.

I like my way better though. No user switching. All users available all the time.
 
  


Reply

Tags
sessions, switch


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Enlightenment: switch users like KDE? trashbird1240 Slackware 22 12-23-2008 01:24 PM
How do i switch users in a shell script? koobi Programming 8 01-05-2008 03:19 PM
Switch users sessions without restarting X? itz2000 Slackware 15 09-29-2007 03:49 PM
Switch Users in X ? CRego3D Linux - General 12 01-27-2003 07:14 AM
switch users within a script kilobravo Linux - General 4 01-14-2003 04:39 PM


All times are GMT -5. The time now is 10:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration