Difference between revisions of "Switch users from terminal"

From ArchWiki
Jump to: navigation, search
(prepare for reforming Template:Merge as discussed in Category_talk:Template#Article status reason)
(redirected page to su)
 
(3 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Merge|Post Installation Tips||Talk:Post Installation Tips}}
+
#REDIRECT [[su]]
If you have more than one normal user account on a computer, you might find the need to run programs as the other user (instead of the user you are logged in as).
+
 
+
In such a situation, the 'su' command comes in handy.
+
 
+
Let us assume that the two users are <i>user1</i> and <i>user2</i>, and that you know the passwords for both users. Type the following if you are logged in as <i>user1</i> and need to run a program as <i>user2</i>.
+
 
+
$ su user2
+
Password:
+
 
+
This is all you need if you are going to start a console application, however, if you are going to run a graphical program, you will need to tell the x-server that <i>user2</i> has to be allowed to use X too.
+
 
+
Again, as <i>user1</i> (the user you have logged in as), type one of the following commands
+
 
+
$ xhost user2
+
$ xhost +user2
+
$ xhost +
+
 
+
The first and second are synonymous to each other, while the third command allows <b>any</b> user or host to run a program that requires x-authority. For further details on the xhost program, see its man page.
+

Latest revision as of 03:17, 16 December 2012

Redirect to: