Slashdot Mirror


Persistent Terminals For a Dedicated Computing Box?

Theovon writes "I just built a high-end quad-core Linux PC dedicated to number-crunching. Its job is to sit in the corner with no keyboard, mouse, or monitor and do nothing but compute (genetic algorithms, neural nets, and other research). My issue is that I would like to have something like persistent terminal sessions. I've considered using Xvnc in a completely headless configuration (some useful documentation here, here, here, and here). However, for most of my uses, this is overkill. Total waste of memory and compute time. However, if I decided to run FPGA synthesis software under WINE, this will become necessary. Unfortunately, I can't quite figure out how to get persistent X11 session where I'm automatically logged in (or can stay logged in), while maintaining enough security that I don't mind opening the VNC port on my firewall (with a changed port number, of course). I'm also going to check out Xpra, but I've only just heard about it and have no idea how to use it. For the short term, the main need is just terminals. I'd like to be able to connect and see how something is going. One option is to just run things with nohup and then login and 'tail -f' to watch the log file. I've also heard of screen, but I'm unfamiliar with it. Have other Slashdot users encountered this situation? What did you use? What's hard, what's easy, and what works well?"

16 of 288 comments (clear)

  1. Screen works welll by Miros · · Score: 5, Informative

    For your standard persistent terminals, SCREEN is really your best bet

    1. Re:Screen works welll by alta · · Score: 5, Informative

      The article seemed to mention 2 stages, first needing persistant terminals, which screen is PERFECT for... The second stage will require wine, which means X, which means VNC...

      The guy has answered his own questions.

      --
      Do not meddle in the affairs of sysadmins, for they are subtle, and quick to anger.
    2. Re:Screen works welll by Dr.+Winston+O'Boogie · · Score: 5, Informative

      Nothing new to add, but did want to emphasize that if a text-only terminal is all you need, 'screen' is the way to go. It is one of the lesser known unix goodies, and a true "wonder tool": a tool you cannot live without once you use it.

      The quick primer:

      First time:
          ssh mymachine
          screen
          <do some work>
          CTRL-a-c <create another login session>
          <do some more work in diff dir>
          CTRL-a-1 <back to first login session>
          CRTL-a-d <disconnect>
          exit

      Future times:

          ssh mymachine
          screen -r <resume screen>
          CTRL-a-2 <back to second login session>
          <do some work>
          CTRL-a-d <disconnect>
          exit

      You can create many login sessions inside one screen instance or launch multiple instances of screen on the same box by giving them a name. See the man page for all the goodness.

    3. Re:Screen works welll by Anonymous Coward · · Score: 5, Interesting

      Why not just run it on the console, and connect a KVM with network access to that sucker?

    4. Re:Screen works welll by ckthorp · · Score: 5, Informative

      I prefer screen -R -D to detach any other screen connections which I might have forgotten about.

    5. Re:Screen works welll by FMZ · · Score: 5, Informative

      Throw this in your .bashrc: alias s="screen -RAad" . This makes multiple screen session management really easy. When I want to IRC, I just type "s irc". When I'm checking out how my torrent is going, "s tor". The beauty is, you don't have to do anything different for a new session. If you forget which sessions you have going, just type "s" and you'll be provided with a list of existing screen sessions.

    6. Re:Screen works welll by maverickbna · · Score: 5, Informative

      Try NX. It's free edition will do what you need just fine, and provides persistent X11 connections. www.nomachine.com

      --
      You are great player! Present you with points!
  2. ssh + vnc by Destrius · · Score: 5, Informative

    You could use VNC, but set it up so the vnc server is only accessible via localhost, and then use ssh to create a secure tunnel back to your client. Alternatively I sometimes use vnc and ssh with X11 forwarding, i.e. the actual graphical data being sent over the network is over X11 as opposed to VNC's protocol.

    screen is cool and pretty easy to use, RTFM. But its command-line only, so not applicable if you need GUI as well.

  3. screen by vengeful · · Score: 5, Insightful

    The usefulness of screen cannot be overstated.

  4. Simple answers. by crazyvas · · Score: 5, Informative

    Use screen for terminals. x11vnc for GUI. x11vnc can be run over encryption. Look at http://www.karlrunge.com/x11vnc/ for more info.

  5. freenx / nxserver by mikey573 · · Score: 5, Informative

    For persistent GUI sessions, I generally use nx/nxserver/freenx:
    http://freenx.berlios.de/

    For console sessions, nothing beats "screen". I use the command "screen -m -R" to create and/or reconnect to an existing session.

    I used to like VNC, but I got tired of how difficult it was to set up. On Windows boxes, I stick to Remote Desktop Connection.

  6. SSH Tunnel to protect VNC by brownsteve · · Score: 5, Informative

    This is what I do every morning to get into work.

    Start up a VNC server on the remote box and leave it running. No need to open holes in your firewall except for SSH, which is pretty safe to do.

    To tunnel through the firewall and log in, type these commands on your local machine:

    ssh -f -N -L 5901:localhost:5901 -X username@remotebox.example.com
    vncviewer localhost:5901

    Voila: VNC connection, secured by SSH. When you are done just

    killall ssh

    .
    Note that 5901 means the :1 VNC session, 5902 means :2, etc.

    1. Re:SSH Tunnel to protect VNC by LeafOnTheWind · · Score: 5, Interesting

      No need to open holes in your firewall except for SSH, which is pretty safe to do.

      I would strongly disagree with this statement. Because ssh has the ability to do so much, it deserves special attention to security. The default implementation should be tweaked more than a little bit, including disabling password login, changing the port and, please don't forget, disabling ssh1. There are other, more subtle, cryptographic attacks, but even those few changes should make it more secure.

  7. What I read by krappie · · Score: 5, Funny

    "I really want this feature. I've heard of this program that's made for exactly the feature that I want, but I'm unfamiliar with it. HELP ME SLASHDOT YOU'RE MY ONLY HOPE!!1!"

  8. Sun Rays by Paul+Jakma · · Score: 5, Informative

    Sun make pretty neat thin-client terminals called Sun Ray. Can work with either Linux or Solaris servers.

    NB: I'm biased, as I work for Sun.

    --
    I use Friend/Foe + mod-point modifiers as a karma/reputation system.
  9. Re:screen by Yogiz · · Score: 5, Funny

    Slackware distro:
    cd /usr/src/tar
    wget ftp://ftp.gnu.org/gnu/screen/screen-4.0.2.tar.gz
    cd ..
    tar -xzf tar/screen-4.0.2.tar.gz
    cd screen-4.0.2
    CFLAGS=" -O2 -march=pentium-m -pipe -fomit-frame-pointer"./configure --prefix=/usr
    make
    mkdir /tmp/screen_install
    make DESTDIR=/tmp/screen_install install
    cd /tmp/screen_install
    mkdir install
    vim install/slack-desc
    makepkg screen-4.0.2-i686-1.tgz
    installpkg screen-4.0.2-i686-1.tgz
    cp screen-4.0.2-i686-1.tgz /usr/src/packages
    cd ..
    rm -r screen_install

    What? Difficult? What are you talking about, that's the only good way.