WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: X started by .profile on console when logging in remotely  (Read 2598 times)

Offline ToasterKing

  • Newbie
  • *
  • Posts: 14
X started by .profile on console when logging in remotely
« on: June 16, 2011, 06:24:15 PM »
By default logging in starts X.  I like to run with the noautologin boot code and frequently log in across the network.

X gets started leaving anyone who walks by the box able to pop up a shell as me even though I logged in via a text-only ssh session.  My suggested fix for this is below.

To only start X from the console, change the last few lines in the users .profile from:

[ ! -f /etc/sysconfig/Xserver ] ||
[ -f /etc/sysconfig/text ] ||
[ -e /tmp/.X11-unix/X0 ] ||
startx

to:

term_type=`/usr/bin/tty`
[ ${term_type:5:3} = "tty" ] && (
    [ ! -f /etc/sysconfig/Xserver ] ||
    [ -f /etc/sysconfig/text ] ||
    [ -e /tmp/.X11-unix/X0 ] ||
    startx
)

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: X started by .profile on console when logging in remotely
« Reply #1 on: June 16, 2011, 06:50:38 PM »
Use the boot code 'text'.

Offline ToasterKing

  • Newbie
  • *
  • Posts: 14
Re: X started by .profile on console when logging in remotely
« Reply #2 on: June 16, 2011, 06:59:13 PM »
The 'text' boot code prevents X from being launched on login at all (without the user typing 'startx').  The tweak launches it on login, but only on local login.

The effect is that locally it looks no different than 'noautologin' by itself but the remote launch of the desktop no longer  happens.

Happy to keep making the change locally, but the tweaked version seems more correct to me.

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: X started by .profile on console when logging in remotely
« Reply #3 on: June 17, 2011, 12:25:16 AM »
@ToasterKing, Your suggestion is more flexible and is therefore accepted. Thanks. Look for it in v.3.7.1.
10+ Years Contributing to Linux Open Source Projects.