Please create an account to participate in the Slashdot moderation system


Forgot your password?
Unix Operating Systems Software

Persistent Terminals For a Dedicated Computing Box? 288

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?"
This discussion has been archived. No new comments can be posted.

Persistent Terminals For a Dedicated Computing Box?

Comments Filter:
  • Screen works welll (Score:5, Informative)

    by Miros ( 734652 ) * on Sunday June 29, 2008 @11:01AM (#23990391)
    For your standard persistent terminals, SCREEN is really your best bet
    • by mrmeval ( 662166 )

      Screen works for text. Does it allow persistent and secure connections for types of programs mentioned in the article?

      • by Anonymous Coward on Sunday June 29, 2008 @11:08AM (#23990487)

        Screen is a most excellent utility for persistent terminals, but (as far as I know) it will not let you keep persistent X11 information.

      • by alta ( 1263 ) on Sunday June 29, 2008 @11:36AM (#23990781) Homepage Journal

        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.

      • by Anonymous Coward on Sunday June 29, 2008 @11:53AM (#23990933)

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

    • by Lord Apathy ( 584315 ) on Sunday June 29, 2008 @11:15AM (#23990547)

      Agreed. I built something like that a few years ago. It had a vt100 sitting on top of it and I used screen to keep up with the data. Screen is easy to use. The only real command that you will need is screen -R. The -R will tell it to resume the screen session in the background and if there isn't one to create it.

    • by Dr. Winston O'Boogie ( 196360 ) on Sunday June 29, 2008 @11:36AM (#23990783)
      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
          <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>

      Future times:

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

      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.
      • Re: (Score:3, Interesting)

        If all you are doing is establishing a persistent ssh connection, you may want to think about using dtach []. It's the equivalent of vi to emacs. Why use an operating system when all you need is a text editor?

    • so is google. im not against people looking for help, but i would think ask slashdot could limit itself to unusual problems. ssh/x forwarding/screen is pretty elementary stuff.

      what a ridiculous thing to put on the front page. any number of forums or HOWTOs probably provide all the information the submitter is looking for, so id like him to read looks long, but its a quick read.

      How to ask questions the smart way []

      /ill take the karma hit, if the subby will do his own research from now on

  • by vlad_petric ( 94134 ) on Sunday June 29, 2008 @11:01AM (#23990399) Homepage
    Yeah, it's not free as in speech, but otherwise beats the crap out of vnc.

    Captain Obviousman.

    • by agoliveira ( 188870 ) <> on Sunday June 29, 2008 @11:03AM (#23990433)

      Yeah, it's not free as in speech, but otherwise beats the crap out of vnc.

      Captain Obviousman.

      FreeNX is free and works to what he wants as well.

    • by Red Storm ( 4772 )

      I've got it running on my personal machines which are sitting in a colo. It runs over SSH which is great and I locked down SSH to only allow "trusted" users and everything works great! I haven't played with it's Samba integration but it's supposed to allow you to share files from your windows Client with your NX session. Also NX will apparently pipe audio across the link but I haven't played with this yet. For my needs it's been perfect.

      Oh ya... the server (Linux) and client (Windows/Linux) are both fre

  • ssh + vnc (Score:5, Informative)

    by Destrius ( 956 ) on Sunday June 29, 2008 @11:02AM (#23990407)

    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.

    • Re: (Score:3, Informative)

      by Curtman ( 556920 )
      Or just forward the VNC port. Should be 5900 for screen :0. It'll be faster than raw X11 forwarding.
    • Re: (Score:3, Informative)

      by Scherpbier ( 470856 )

      If you use xtightvncviewer, it has the "-via" option which sets up a tunnel (ssh is the default) for the connection. Only ssh needs to be exposed through the firewall that way.

      Alternatively, set up OpenVPN (either through a dedicated firewall or on your linux box) or other VPN so you can access the VNC server as if you were local to your network.

  • screen (Score:2, Informative)

    by Chris Snook ( 872473 )

    Yum distro:
    yum install screen
    man screen

    Apt distro:
    apt-get install screen
    man screen

    • Re: (Score:3, Informative)

      by Ice Wewe ( 936718 )
      Gentoo distro:

      emerge -av screen

      Mac OS X:
      fink install screen

      • Mac OS X:
        fink install screen

        That or:
        sudo port -v install screen

      • Actually, for Mac OS X it's even simpler, as screen comes with the base OS:

        mymac:~ username$ which screen

      • Re:screen (Score:5, Funny)

        by Yogiz ( 1123127 ) on Sunday June 29, 2008 @02:16PM (#23992043) Journal

        Slackware distro:
        cd /usr/src/tar
        wget []
        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
        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.

        • by DarkOx ( 621550 )

          Stop frightening the non-slackers, screen is in the disto slashdoters.

          1.Insert dvd or download slackpack from (Hey you could even use your browser!)
 /{directory containing package}
          3.installpkg screen-X.X.X-i386-1.tgz (replace X as required: hint match the file name.)

          A bit easier then the above I think, and no you won't get any uber-leet-performance by doing your own build.

  • Use screen (Score:2, Informative)

    by Whatsisname ( 891214 )

    Nothing beats screen for terminals.

    I use irssi + screen so I can be in some of my irc channels all the time, and connect to it from wherever I can run an ssh client.

  • Go with screen (Score:2, Informative)

    Given that it's made specifically for persistent terminals across login sessions, Screen is definitely worth learning. If your needs are text-based, it's the best way to go.

    It sounds like your GUI needs are rare. In those occasions you could probably fire up a VNC or other session when you need it (from the remote screen session) and shut it down again when you're done.

  • screen (Score:5, Insightful)

    by vengeful ( 734172 ) on Sunday June 29, 2008 @11:04AM (#23990435)
    The usefulness of screen cannot be overstated.
    • Re:screen (Score:5, Insightful)

      by Lord Apathy ( 584315 ) on Sunday June 29, 2008 @11:17AM (#23990569)

      Screen is one of the greatest and useful commands ever envisioned.

      • Re:screen (Score:4, Informative)

        by SuperQ ( 431 ) * on Sunday June 29, 2008 @12:26PM (#23991223) Homepage

        And of course my favorite thing in my .screenrc:

        # turn sending of screen messages to hardstatus off
        hardstatus on
        # Set the hardstatus prop on gui terms to set the titlebar/icon title
        termcapinfo xterm*|rxvt*|kterm*|Eterm* hs:ts=\E]0;:fs=\007:ds=\E]0;\007
        # use this for the hard status string
        hardstatus alwayslastline
        #hardstatus string "%h%? users: %u%?"
        hardstatus string "%{.bW}%-w%{.rW}%n %t%{-}%+w %=%{..G} %H %{..Y} %m/%d %C%a "

        • Re: (Score:3, Informative)

          I'm a zsh user, I've got this in my .zshrc ... I've never tried to post a code snippet to Slashdot, hopefully it doesn't mangle it too badly...

          case $TERM in
          preexec () {
          export CURRENTCMD="$1"
          if [ x$WINDOW != x ]; then
          print -Pn "\ek$1\e\\"
          print -Pn "\e]0;[$USER@$HOST] $1\a"
          precmd () {
          if [[ ! -z $CURRENTCMD ]]; then
          if [ x$WINDOW != x ]; then

      • And Screen, used as directed, is absolutely safe.
  • Simple answers. (Score:5, Informative)

    by crazyvas ( 853396 ) on Sunday June 29, 2008 @11:05AM (#23990455)
    Use screen for terminals. x11vnc for GUI. x11vnc can be run over encryption. Look at [] for more info.
  • This might be a stupid question, but does it really actually make sense to run big number crunching applications on top of WINE? I know WINE performance is really quite amazing considering what it is, but at the same time, if you have a job that you expect to run for a long time doing a lot of work (especially a threaded one) repeatedly you should probably re-implement it if you can natively. OpenMP is kind of fun
    • All code except system calls runs natively, and therefore just as fast as native code.

      • by Miros ( 734652 ) *
        to be honest, that's pretty sweet =)
      • Re: (Score:3, Interesting)

        by bucky0 ( 229117 )

        That's true, but if he's talking about graphics things, there is a LOT that is emulated. Google "DIB engine wine" for a look.

        Basically, unless you're using DirectX/OpenGL, windows makes assumptions about the graphics layer that can't be directly done in X. AFAIK (it's hard to understand), many of the earlier windows libraries give the program direct shared access to where they are rendering, but X11 has the program and the actualy framebuffer divided by the X11 layer. Emulating that blows in terms of perfor

  • freenx / nxserver (Score:5, Informative)

    by mikey573 ( 137933 ) on Sunday June 29, 2008 @11:06AM (#23990471) Homepage

    For persistent GUI sessions, I generally use nx/nxserver/freenx: []

    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.

    • nx* = PITA (Score:4, Interesting)

      by Nicolas MONNET ( 4727 ) <> on Sunday June 29, 2008 @11:29AM (#23990717) Journal

      You think VNC is difficult to set up? Well NX is just absurdly complicated. That one time I managed to get it working, it was indeed vastly superior to VNC, but I just can't fucking understand why they have to install their own damn SSH server and keys. Why? WHY???
      How come it's not been picked up by any major distribution? Probably because installing it by following the megabyte-long HOWTOs feels like an exercise in computer masochism.

      • Re:nx* = PITA (Score:4, Informative)

        by Burz ( 138833 ) on Sunday June 29, 2008 @11:46AM (#23990883) Homepage Journal

        Not seperate ssh server... unless you're on Windows?

        Separate key is needed because nx must do session/login management from root. Simple as that. Once I grasped that, the rest came easy (I will admit to being familiar with ssh configuration though).

      • by Red Storm ( 4772 )

        How come it's not been picked up by any major distribution?

        SuSE has had it for a while now. My recollection of seeing it in YAST goes back at least a year. It's a *SNAP* to setup under SuSE. Select the package, then go to the docs directory and read the SuSE readme, run the setup program. Done, less than 10 minutes start to finish. If anything the windows client is more confusing than the Linux server under SuSE. :-)

    • ...I've always had more luck getting it to work right than with freenx. But the latter has a KDE session integration now so the auther may want to look into that.

      The session handling and preservation of nxserver is very good.

    • by Covener ( 32114 )

      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.

      I've always found VNC dead-simple to install/configure/run, except on the cruftiest of old unix systems where the environment setup was busted.

      Typically it's one-liner native package install, run 'vncserver', and change your window manager if you're picky.

  • Keep it simple - this is what screen was meant for. Install it and read the man page, it's really easy to use.

  • by brownsteve ( 673529 ) on Sunday June 29, 2008 @11:10AM (#23990511) Homepage

    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
    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.

    • by ink ( 4325 ) * on Sunday June 29, 2008 @11:33AM (#23990755) Homepage
      You can also just end the SSH session (don't background it with '-f') to cut the tunnel. This also works with PuTTY for Windows machines. I've setup PuTTY shortcuts for some of my coworkers and they just double-click on them, enter their passoword, and they're using VNC just fine. When they want to stop using it, they just close PuTTY. Easy as pi.
      • and if you use pageant, password is a one-time affair. However, if he's using a closed-lan system, then he could use a passwordless key so he can SSH on just by clicking a link.

    • by LeafOnTheWind ( 1066228 ) on Sunday June 29, 2008 @12:49PM (#23991393)

      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.

      • by ink ( 4325 ) *

        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.

        Disabling passwords is a double-edged sword. On the one hand, it's more difficult to forge credentials, but on the other hand, a stolen, carelessly-maintained laptop grants full access. Either way, you trust the end-user to secure her system -- it's just that with passwords, they are more likely to re-type them every time (most ssh clients do not save the password). With a key exchange, they are much more likely to have it fire-and-forget.

    • Would be nice if VNC just did the freakin' encryption and screen locking by default and automatically, like Windows Remote Desktop.

      Why does Linux stuff always have to be so goddamned hard to use? I swear, Linux coders simply hate end-users, there's no other explanation.

      • Re: (Score:3, Insightful)

        by ystar ( 898731 )

        Feeding trolls is always fun, so:

        The idea is modularization. VNC does one thing, and does it (sort of) well. SSH does one thing and does it well in version 2. If you can't use SSH authentication in a setting, then you're still able to use VNC with some other auth mechanism. RemoteDesktop is inflexible and monolithic, if one component in the chain is a problem you have to abandon the whole solution. The modularity of *nix is it's strength, but it also makes things more difficult for novices. Windows is there

  • Terminals mainly? (Score:3, Interesting)

    by LinuxGeek ( 6139 ) * <djand DOT nc AT gmail DOT com> on Sunday June 29, 2008 @11:12AM (#23990527)

    Try conspy [], very handy utility.

  • Quick primer (Score:5, Informative)

    by Nicodemus ( 19510 ) on Sunday June 29, 2008 @11:13AM (#23990535) Homepage

    Here's a quick primer. These are the commands I use all the time. There are a ton more in the man pages or online help.

    "screen" to start a new shell under screen

    All commands start with CTRL-A, then another key for the command itself. If you really want to send a CTRL-A to your application (Like to go to the beginning of the current line in bash for example, hit CTRL-A twice.)

    CTRL-A CTRL-D Detach your current session

    "screen -rd" to get back to it

    CTRL-A CTRL-C create another "window"
    CTRL-A CTRL-N next window
    CTRL-A CTRL-P previous window
    CTRL-A " see list of current windows
    CTRL-A [ Copy mode... you can see the scrollback buffer with this. Esc to exit
    CTRL-A ? Help for further stuff.

    I run just one instance of screen with multiple "windows." Works beautifully. When you start running more than one screen process under the same user it can make it difficult to re-attach because you have to tell it which pty to attach to.


  • fpga tools (Score:4, Informative)

    by scatterbrained ( 144748 ) on Sunday June 29, 2008 @11:16AM (#23990563) Journal

    The xilinx fpga tools run just fine (perhaps better) from the command line, and have native ports to linux. I believe the same is true for Altera. If you run the xilinx gui tool with the command line log file turned on, it will give you a look at what's required.

    IIRC, screen has a pretty detailed man page and has been around a very long time, so should be pretty easy to find examples of setting it up.

    For X, usually the real pig is the display server. If you have to run X read up on using the DISPLAY environment variable and just run the X clients on the box and run the server somewhere else - that's what it was made for ;-)

  • What I read (Score:5, Funny)

    by krappie ( 172561 ) on Sunday June 29, 2008 @11:25AM (#23990667)

    "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!"

    • by rhizome ( 115711 )

      "There should be a way to send words to another computer about things that I would like to know more about. I bet someone could make a lot of money by inventing a service such as this."

  • NX (Score:3, Interesting)

    by Bert64 ( 520050 ) <bert AT slashdot DOT firenzee DOT com> on Sunday June 29, 2008 @11:28AM (#23990707) Homepage

    Try NX, []
    It's orders of magnitude faster than VNC or native X11, and supports persistent sessions as you describe...
    It also runs over SSH, so it benefits from the inherent security of SSH.

    I would never even consider using VNC, entirely pointless... slower than native X11.

    • by Covener ( 32114 )

      I would never even consider using VNC, entirely pointless... slower than native X11.

      In my experience, once you go beyond two systems on the same LAN, vnc copes with the latency much better than native X11. For some reason, swing apps seem to suffer the most (more round-trips baked into how they use X?)

      There's also the issue of unreliable links/roaming/etc which are big pluses for vnc/nx.

      IMO NX is only marginally better performing than vnc.

    • by Zardus ( 464755 )

      Another vote for NX here. I've been using it for years and VNC doesn't hold a candle.

      Also, NX tunnels communications over ssh, so if you're ok punching ssh through the firewall (or already do so), there's no problem.

  • by jhealy ( 91456 )

    translation: can someone tell me how to use screen?

    let's see, how can i write this so no one will call RTFM on me...

  • Sun Rays (Score:5, Informative)

    by Paul Jakma ( 2677 ) on Sunday June 29, 2008 @11:56AM (#23990971) Homepage Journal

    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.

    • Huh.. If all the other posters who read the question as being about purely *text* terminals (despite mention of VNC) are correct, then their suggested answer of "use screen or dtach" are of course much better than using Sunrays. ;)

      • Re: (Score:3, Interesting)

        by McKing ( 1017 )

        Uh, the original poster talked about persistent X11 sessions. The Sun Rays are perfect for this. The OP can even have one at home set up to connect to his Sun Ray server at work, detach from the session at the end of the day and reconnect to it from home.

        Sun Rays are really one of the coolest technologies to come out of Sun in the last 20 years, but unfortunately, they are such a shift from the norm (and until recently needed Solaris on Sparc for the server) that most companies have no idea of their poten

    • by florin ( 2243 )

      I really wish Sun Secure Global Desktop were a free product or had some sort of free edition. It's all the things VNC and FreeNX aren't, and compares well with Remote Desktop and Citrix, but at 100$/seat it's never gonna matter.

  • Screen is a great utility. I wrote about it here: [] and will not repeat myself.

  • I know this is offtopic and you didn't ask this question, but instead of using CPU (or ultimately FPGA like it sounds you might), have you looked into running calcs on a graphics card?

    I also have a genetic algorithm, neural net, artificial life project that needs lots of processing power, after looking at my options (cluster of pc's, cluster of PS3's, FPGA's, GPU's), I found that GPU's look like the best bang for the buck by far.

    I've just started the process of converting my critical code to nvidia's C
  • I use the same on my home box. I setup kdm to automatically log my default user in right after startup, and put this

    s2@fresh:~$ cat .kde/Autostart/x11vnc
    (while true; do /usr/bin/x11vnc -forever -nopw; sleep 10; done) &

    autostart file in as well, so I have a vnc server listening and sharing that desktop. The vnc port (5900) is firewalled from outside the lan, so it's relatively secure. To access it I use an ssh tunnel, so traffic is encrypted, and when I close my vncviewer window and

  • Xvfb (Score:3, Interesting)

    by kreuzotter ( 13645 ) on Sunday June 29, 2008 @12:06PM (#23991047)

    I use Xvfb to make a virtual screen on the number cruncher (comes with xorg). I don't need to see the display, it just has to be there for wine. If something goes wrong (error box pops up) and there is no progress I take a screen dump of the vortual screen to see it. This eliminates traffic on the network too.

  • XRDP works pretty well. It's basically an RDP "wrapper" for VNC, and should be secure "enough" for your use.

    If you need a GUI for the apps, then you need a GUI for the apps. I wouldn't worry much about the overhead since WINE itself will have much more anyway. We're talking here about under 0.5% of your CPU/Memory, which is trivial.

    I like it for conveninece since there's no need to install "agents" or specific client-side software. Any Windows box (Post Win2K) has an RDP client, as do most Linux distros

  • If you can't be sure yet what else you might need to export from this machine, in particular for access as a roadwarrior too (just terminals or also file shares to get data into and out of future projects, and possibly even forwarded access to further machines on the LAN?), 3SP's SSL-Explorer [] might be a good package comprising VNC, RDP etc., console prompts, network paths, web forwards (mostly through a Java helper that runs from many browsers), all encrypted as the name implies, and even more in in its com
  • The easiest way to get a persistent session is to Use the regular vncserver from a SSH command line.

    I do it all the time. I suggest you make sure to enable compression and don't go overboard with graphical apps if you access it from the WAN.

  • by Anonymous Coward on Sunday June 29, 2008 @12:46PM (#23991373)

    Microsoft's remote desktop simply works better than anything in the unix world. Screen is wonderful, but if you want to maintain an entire work session state across several locations, nothing beats RDP.

    Why hasn't someone made an X server that uses RDP as the graphics device? Xnest is already 99% of the way there. I'd log in, and if I don't have a session it would create one, if I do have one it would reattach to that one, or maybe give me the option to create a new one.

    I could use this in a 100% linux environment using rdesktop to connect to the server (instead of using xdm and Xnest, for instance). It would also work really well in a mixed windows/linux environment because I could use the windows remote desktop client to connect to a linux server and use X programs. Lastly, it would be great for POS applications because 99% of thin client systems already use RDP.

    lets get cracking!

    • by florin ( 2243 ) on Sunday June 29, 2008 @02:10PM (#23991987)

      [quote]Microsoft's remote desktop simply works better than anything in the unix world[/quote]

      Sadly, you're not wrong, even though many will refuse to admit it. There's a bit of NIH syndrome going on here and also a general lack of understanding why neither X nor VNC are as functional as Remote Desktop.

      Sun's Secure Global Desktop (previously known as SCO Tarantella) actually compares really well in the Unix world, but it's payware even if you need just 1 or 2 seats - functionality that is included with the OS with Remote Desktop. Sun, do all of us, Unix and yourself a favor, and give this product away. Sell licenses to compete with Terminal Server and Citrix, not with Remote Desktop. Pretty please :)

  • I agree, "screen" is the absolute best answer. I've been using it since the early days, and it's only gotten better (split screens, etc.)

    My question: I'd like to be able to list the files in a directory. I've been using "echo *", but it's formatting is a little rough. I've also heard of "ls", but I'm unfamiliar with it. Have other Slashdot users encountered this situation?

    (Seriously, though, this seems like a pretty light question to warrant a slashdot article. *Any* semi-experienced Unix admin should b

    • Also, the poster indicated he had already heard of screen. An "apt-get install screen" and "man screen" would have answered his question pretty quickly.

      (On the other hand, I'm such a big fan of screen, having the word spread on it a bit more is for the common good, I guess...)

  • by vlm ( 69642 ) on Sunday June 29, 2008 @01:18PM (#23991653)

    Once you're comfortable with screen, which only took me a couple days, back in the mid 90s, add this as the last line of your .bash_profile

    exec /usr/bin/screen -xRR

    Upon ssh'ing into the box, that'll set up a screen session, or if one currently exists, reattach to it.

    Also, if you log in multiple times, from different PCs or whatever, all your logins see the same screen session, which can be convenient if you're "sharing" logins.

    To disconnect from the session, just "C-a z" and your ssh connection will drop.

    You'll probably want to customize your .screenrc file also. I advise setting

    vbell off
    escape ^zz
    nonblock on
    deflogin off
    startup_message off
    screen -t procinfo 0 watch -n 60 procinfo
    screen -t bash 1
    bindkey -k k1 select 1
    bindkey -k k2 select 2 .... you get the idea .....
    bindkey -k k; select 110
    bindkey -k F1 select 11
    bindkey -k F2 select 12 ... etc ...
    Oh and set a useful caption line too.

    • by vlm ( 69642 )

      Err forgot about this.... although it should be pretty obvious.

      Good luck running emacs without this line:

      escape ^zz

      in your screenrc. On the other hand you better read the screen man page and understand what that does before you try it.

      Personally, I feel control-A is more useful in emacs, etc, than control-Z. Who needs control-Z when you can just open another screen window with a quick "control-Z c"

      I have heard of people remapping the screen control key to other keys but people mostly use the default "a"

  • I would think that you could just sign up with Amazon and run a virtual linux instance under Xen on their Elastic Compute Cloud. I don't mean to sound like a commercial, but it seems perfect for this sort of number crunching. You start a virtual server, push your code onto it (in a bash script) and you run. If you want to run multiple instances, its just as cheap to run 4 concurrent servers as it would be to run one server 4 times as long. At $0.10/hour, this should be a good deal.
  • by 5pp000 ( 873881 ) on Sunday June 29, 2008 @02:13PM (#23992017)

    I've used VNC routinely for this kind of purpose for years -- in fact, I do almost all my programming work using it. I have not found it to be a resource hog by any means. Just checking some of my VNC sessions now, resident memory use by the Xvnc process seems to stay between 20 and 60MB. At current memory prices, this is pretty much negligible (and I would assume you have plenty of DRAM on your compute box -- 8GB at least, yes?).

    Others have mentioned SSH tunnelling -- I can assure you this is reliable; I've used it day in and day out for years.

    Use Screen if you want, but personally I wouldn't even think twice about using VNC.

  • Wow.. a decade ago knowing about screen would have been pretty common and necessary knowledge. Now we have to Ask Slashdot for instructions for using it?

    It seems like we've some how failed in the Linux community to instill this knowledge. Even worse, Soulskill felt that it was important enough to warrant posting to Ask Slashdot.

    Don't get me wrong - I don't think we need another tutorial. In fact, quite the opposite. I bet if you put "screen tutorial" into Google it'll come up with tens of thousands of m

  • Screen is designed for exactly what you are wanting. I wouldn't look at anything else.

    It's easy to use, takes about 5 minutes to figure out how to use it.

  • Run getty on a serial port with no hardware flow control. Run a terminal emulator on a laptop. Use a null-modem cable to connect. Unplug when you are done and the session continues to run. Security is either great or it sucks, depending on your situation, because physical access is necessary and sufficient. Very old-school, but cheap and easy. Run screen if you need multiple sessions. Text-only, though.

  • It's 100% exactly what you are asking for. So exact, in fact, that I wonder why somebody didn't just answer you before this even became a story.

"Hey Ivan, check your six." -- Sidewinder missile jacket patch, showing a Sidewinder driving up the tail of a Russian Su-27