Results 1 to 10 of 10
we all know that we can use su to change as root from terminal to work on important files.
is there is any possibility to switch as another normal user ...
- 08-24-2006 #1Just Joined!
- Join Date
- Aug 2006
- Location
- London Uk
- Posts
- 93
is it possible to change between users from terminal
we all know that we can use su to change as root from terminal to work on important files.
is there is any possibility to switch as another normal user from the terminal.
for ex:
if we have two normal users: user1 and user2
if i am logged in as user1, is it possible to change as user2 if know user2's password.
thanks.
- 08-24-2006 #2
Yep, the same su command will do it:
Code:$ su user2 Password:
Stand up and be counted as a Linux user!
- 08-24-2006 #3Just Joined!
- Join Date
- Aug 2006
- Location
- London Uk
- Posts
- 93
thanks very much...that works
- 08-24-2006 #4Just Joined!
- Join Date
- Aug 2006
- Location
- London Uk
- Posts
- 93
i have a doubt...if i change to another user in terminal...then i am able to do operations related to the changed user only in terminal but the graphical interface still points to the old user and i am not able to operations related to the changed user lets say in gnome.
- 08-24-2006 #5
if you change the user in terminal you would be able to do anything with that user in terminal.To change user in GUI (Graphical user interface) log out and log in as diferent user
i hope that helps
- 08-24-2006 #6launch GUI from terminal...
Originally Posted by raghavan20
for file browser
$ nautilus
<=== { casper } ===>It is amazing what you can accomplish if you do not care who gets the credit.
New Users: Read This First
- 08-24-2006 #7Just Joined!
- Join Date
- Aug 2006
- Location
- London Uk
- Posts
- 93
casper your answer sounded interesting,,,but when i tried to launch nautilus, it says.
i then tried to open a file belonging to the changed user from terminal in kwrite...it displays the following...Code:Xlib: connection to ":0.0" refused by server Xlib: No protocol specified (nautilus:3272) Gtk-WARNING **: cannot open display:
Code:Xlib: connection to ":0.0" refused by server Xlib: No protocol specified kwrite: cannot connect to X server:0.0
- 08-24-2006 #8
Ah, no. You have to be in X already. So with X running as user1, if you open an xterm (or Konsole, or GNOME Terminal, or whatever), change user, and run a graphical application, it will run as the changed user.
DISTRO=Arch
Registered Linux User #388732
- 08-24-2006 #9Just Joined!
- Join Date
- Aug 2006
- Location
- London Uk
- Posts
- 93
alright...i will explain again what i did
l logged in to X as user1, opened terminal, used su user2, tried to launch nautilus and it gave up the error i posted earlier.
- 08-24-2006 #10
Right, that's due to something called xauthority. By default, only the user who's logged into the X session has the authority to launch X clients. You can pass your authority to others using the xhost command. As user1,
will allow user2 to use your X server, orCode:$ xhost user2
allows anyone and everyone to use it. See the xhost manpage for more details.Code:xhost+
My preference is to install the sux package and just use sux instead of su to switch users, and sux takes care of all the authority stuff.Stand up and be counted as a Linux user!


Reply With Quote
