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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-11-2017, 10:51 AM
|
#1
|
Member
Registered: Jan 2017
Posts: 32
Rep:
|
X won't work with new user
Hi folks.
Well, the subject title is descriptive of what I assume the problem might be anyhow.
So, I created a new user, and it seems like he can't start any GUI-applications - emacs with GUI for example. Instead I get this:
...@---:~$ No protocol specified
Display :0.0 unavailable, simulating -nw
Now this thread on unix.stackexchange suggested running "xhost +" which returns "access control disabled, clients can connect from any host" which I find rather unsettling in its generality, and exporting the DISPLAY which I did, and now it works - "xhost + <name>" though did not seem to do anything usable, although it said "<name> is being added to access control list".
So how can I allow the new user as a new client to X without slaying access control altogether? Like, add permission to access to only a particular user?
Also is there a guide on how to set up new users that covers obvious complications like these? I dread trying to use any network application, and emacs startup suggests this is warranted. Most of what I found so far offers little further information than an introduction to adduser and usermod.
Come to think of it, not that I really have the time to deal with it in depth, but I guess I will have to anyway some day, is there some kind of comprehensive guide on X, which deals with things like configuring it for users, configuring users for usage of it, manually starting, restarting and killing it? Like, apart from reading the entire documentation?
Best regards.
Last edited by MrMeeSeeks; 08-11-2017 at 10:58 AM.
|
|
|
08-11-2017, 12:09 PM
|
#2
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 22,762
|
when you start X usually you need to log in. This GUI by default can only be used by that user. This user has the right to allow others to use this X instance, for example by executing the command xhost.
you may start here: https://en.wikipedia.org/wiki/X_Window_authorization
|
|
|
08-11-2017, 12:57 PM
|
#3
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
What distro are you using? Usually you just add a user and then log into X with that user's credentials. It's not supposed to be difficult.
|
|
|
08-11-2017, 01:43 PM
|
#4
|
Member
Registered: Jan 2017
Posts: 32
Original Poster
Rep:
|
I'm using xubuntu.
Quote:
when you start X usually you need to log in. This GUI by default can only be used by that user. This user has the right to allow others to use this X instance, for example by executing the command xhost.
|
Yes that is what I have understood so far. My problem is: if I use xhost + the return message is "access control disabled, clients can connect from any host" which does not sound like what I want - I want only clients on my host, better still only one particular user to be granted access. However when I ran "xhost + user-name" the return message was "user-name is being added to access control list" but the user still could not use the X server as it seems.
Quote:
Usually you just add a user and then log into X with that user's credentials.
|
What exactly do you mean by logging into X with that user's credentials?
This post on server fault suggests extracting a hexkey from xauth list to use with xauth add $DISPLAY as the new user. That returned xauth: timeout in locking authority file /home/old-user-name/.Xauthority, which was solved by granting write permissions to that particular file for the new-user - which I'd rather not do. However, is that what you meant by logging into X with that user's credentials? Because it seems like now I used the old-user's credentials.
Further, now I am confused what the proper way to go is: grant access via xhost or authorize via xauth. Worse still, apart from xhost + - which seems to just disable access control altogether - or granting write access to new-user and extracting the hexcode - which seems kind of complicated - I have not found a working solution. I don't really know what to google either.
|
|
|
08-11-2017, 04:39 PM
|
#5
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
Normally when you want to change users you log out of X and log back in as a different user. Each users /home directory contains the configuration files for that user. For instance, if you use gnome3, you click "log out". Then you are back at the log-in screen in gdm3. You click "log in as different user", select the user name you want, enter the password in the box, and it starts the X server for the new user.
You don't really need to do all that other stuff. It's not complicated.
|
|
|
08-11-2017, 04:43 PM
|
#6
|
Member
Registered: Jul 2017
Posts: 362
|
Log in - issue the startx command.
That's how it's done on BSD anyway.
|
|
|
08-12-2017, 02:56 PM
|
#7
|
Member
Registered: Jan 2017
Posts: 32
Original Poster
Rep:
|
Quote:
You click "log in as different user", select the user name you want, enter the password in the box, and it starts the X server for the new user.
|
Ah now I see.
I was trying to solve all my problems so far in relation to switching user in an xterminal, but I guess this will do for now. Although it is somehow unsatisfying and didn't teach me nothing about X.
Quote:
Log in - issue the startx command.
That's how it's done on BSD anyway.
|
Same issue, it seems to default to trying to use the .Xauthority-file in old-users home directory which I don't want new-user to have permissions for.
Well I'll just go with the GUI solution for now and try to live with it until I find the time to understand X properly.
Best regards to everyone.
|
|
|
08-12-2017, 05:23 PM
|
#8
|
LQ Guru
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
|
If you go to a terminal with and do:
Code:
$ ps aux | grep gdm | awk '{print $2}' | xargs sudo kill $1
then gdm3 should respawn and the greeter screen will reappear. Just log in as the new user. Similarly, if X is not running, will bring up the gdm3 greeter screen where you can log in as any user you wish.
It is not useful to leave the xserver running for one user, and execute programs in that session under another user. It's contrary to common sense because of security concerns. And why would anyone need to do that?
|
|
|
All times are GMT -5. The time now is 08:29 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|