Re: [mu startx] only root can start x.

From: Stephen Isard (S.IsardDeleteThis@ed.ac.uk)
Date: Thu May 10 2001 - 17:58:31 CEST


Ben Wheare wrote:
>
> Can't find the thread you are reffering to. Could anyone tell me how to do
> it, as I have this problem as well..

I sent the message below to the list a few months ago. Please note that
it is only suitable for a single user machine, which I think is how
Michele envisaged mulinux being used. As I understand it, the point of
running as a non-root user is for communicating with other machines that
block root access to various services.

Usual caveats that "it works for me".

---- Begin old message ---------------

I have a way both of running X as a non-root user and of getting history
and
line editing in the xterm without having to explicitly type the'ile'
command. It is a crude, brute force method, but perhaps someone will be
inspired to improve on it. The fundamental problem is in getting the
pseudo-terminal in the xterm allocated to the user. I have a less than
complete understanding of how this happens. I thought the job was done
by the xterm program, i.e., aterm or rxvt, and that therefore making
aterm and rxvt be suid root would allow the pty to be allocated, but it
doesn't seem to make any difference.

Anyway, you need to do three things:

1. Replace /usr/X11R6/bin/xterm by the following slightly edited version

---------------------------
#!/bin/sh
# xterm wrapper
# (C) M. Andreoli for muLinux
# edited by Stephen Isard to give a history mechanism in the xterm
window
# and permit starting when logged in as non-root user (but there must be
a
# better way)

#Give things like this as arguments to this program. They will get
passed on
#to the real xterm program, aterm or rxvt, via "$@" in the "command"
line
#below.
#"-bg black"
#"-fg white"
#"-geometry 80x21+20+68"
#" -fn fixed"

ile="/usr/bin/ile -/etc/ilerc"

if [ "`which aterm`" ] ; then
    xterm="aterm"
else
    xterm=rxvt
fi

command="exec $xterm "$@" -e su - $USER -c \"$ile\""

#Next line depends on there being no root password. The reason I've done
it
#this way is that I can't figure out how else to get a pty allocated to
an
#ordinary user. Please fix if you know how.
su - -c "$command"
----------------------

2. In /usr/X11R6/bin/startx, replace occurrences of "MuLinux Console" by
\"Mulinux Console\", i.e., put backslashes before the quotes.

3. Make the loadkeys program be suid root, i.e., as root do
chmod +s `which loadkeys`

There are still error messages involving /setup/cnf/store and
/tmp/modules/preferred, but I don't think they matter. They seem to
come from attempts in setup to create directories that already exist in
this context.

Best wishes,

Stephen Isard

---------------------------------------------------------------------
To unsubscribe, e-mail: mulinux-unsubscribe@sunsite.dk
For additional commands, e-mail: mulinux-help@sunsite.dk



This archive was generated by hypermail 2.1.6 : Sat Feb 08 2003 - 15:27:18 CET