Connecting to Ubuntu machine from PowerBook

I can connect wirelessly to my self-build machine running Ubuntu 12.04, both from my Intel iMac (10.6.8) and my G4 PowerBook (10.4.11), by opening Terminal and typing:


ssh -X username@username-hostname.local


where 'hostname' is the name of the Ubu machine. The 'ssh -X' at the start is something I latched onto early on in my investigating this sort of thing. I'm very, very new to Terminal.


I only need relatively few commands, I think, to do what I need to do from time to time, and accordingly have learned a few which work OK.


This is the Preferences window for Terminal on my PB :


User uploaded file

Regarding the un-selected option "Execute this command (specify complete path):", could I use that to automatically execute the command I noted above so that I could save the tedium of typing what is, unfortunately, a longish username-hostname combination. (I wish I had thought ahead and chosen a really short name for my new machine.)


These are machines in my home, and I'm the only person who will have access to both Terminal and the Ubu machine, so in-home security doesn't even figure in all this.

Posted on Jul 15, 2012 7:24 AM

Reply
14 replies

Jul 15, 2012 8:32 AM in response to etresoft

Well, that command works, giving the same resulting lines in the Terminal window as my "ssh -X" version so does that mean I definitely must have one or other of Bonjour or Zeroconf running on my Ubu machine?


That will save having to type -X in future, thanks.


How can I find out which of Bonjour or Zeroconf is on my Ubu machine? What command(s) will I use?

Jul 15, 2012 10:52 AM in response to etresoft

I'm not sure these are specifically Linux questions that I'm asking - they're maybe more just Terminal questions. Maybe my thread title is wrong. I'm really feeling my way here with all this. That said ...


I decided I'd build a machine specifically for Folding@home, to spare our iMac from the high core temperatures, and which I have now done. I didn't want to fork out for Windows, nor go through the nightmare of setting it up - I did that in Boot Camp on my iMac for another venture and hated it. So I opted for Ubuntu which is free, and which I've discovered is actually a nice OS to use - certainly for my purposes.

My next step will be to disconnect the monitor, keyboard and mouse, and monitor and control everything from one or other of my Apple computers via Terminal.


So far, I am able to control the FAH client on the Ubu machine from the Intel iMac. I can also check for software updates and install them, from either my PB or iMac. A few more items and I think the Ubu machne can go headless.


My main question to start with was concerning the Terminal Preferences, whether I can set it up so that when I open it, it automatically logs me in to the Ubu machine, just requiring me to enter my password. I'd prefer to bypass the password requirement as well, if possible. As I said, I'm the only one who will ever use Terminal in our house - believe me ; - let alone the Ubu machine.

Jul 15, 2012 12:32 PM in response to Rod Fryer

You're launching X with that -X (or -Y), which means you'll need to issue that ssh command from an Xterm session. Install (if it's not already installed) X11 from your distro disks, launch it, then create an Xterm session, then issue the ssh command to the Linux box. (Terminal.app doesn't launch an X Window Server on your OS X system, which is what ssh -X (or -Y) needs to have running on your OS X box to allow the X displays to render on your OS X box. X11.app does that.)


You'll want to check with somebody that knows Ubuntu better than I do (or a Ubuntu-focused forum) around the set-up steps required for this, but starting up an RDP server over on Ubuntu would allow desktop sharing. This using either Screen Sharing within OS X, or installing and using the Apple ARD product, or the (free) CoRD package, can get you screen sharing.


In addition to RDP, remote X displays and remote desktops can also work here, but can tend to be a little clunky.


Or you can use the command-line to manage the Ubuntu box, of course.


The following assumes you're on a NAT'd network... I'd establish a DNS server going here (possibly on the Ubuntu box, if that's going to be up all the time), and also configure the Ubuntu box at a fixed address. Set your DHCP server to pass out the address of the Ubuntu box as the DNS server for your local network.


Here is how to use OS X as an X client (for an entirely different operating system, you'll need to adjust that part for Ubuntu) and a few links to how to set up the ssh private and public keys for a no-password or a passphrase-based login.

Jul 15, 2012 3:54 PM in response to MrHoffman

Thanks for your long reply. I'm sorry to say that I don't really understand most of the technicalities in it. I have an extremely limited exposure to this so far, and have learned a few tricks to achieve what I want.


Although in my first post I set out the command ssh -X user@user-etc, I can achieve the same effect that I want (or so it seems) by simply typing ssh user@user-etc.

For instance, the command sensors works with or without the -X.

Similarly, I can update and/or upgrade the software by issuing the appropriate commands (via aliases I created), with or without the -X.


Basically, I'm happy to acquire the few commands I need to carry out a limited number of tasks.


What I'm wondering, is whether I can shortcut the whole login process after the prompt, and do away with the need for a password.

Jul 15, 2012 5:07 PM in response to Rod Fryer

According to the stats for that project, you would be making a more significant contribution if you used your Macs. There are over 50% more Linux machines but their total processing contribution is virtual the same as Mac. Windows is even worse. Windows machines provide 2.45 times the processing power of the Macs, but it takes almost 10 times the number of machines to do that.


Setting up a login without a password is easy. Run:

ssh-keygen -t dsa


Make sure to provide a passphrase. Many instructions on the internet suggest using an empty passphrase. This is less secure but makes ssh much harder to use - except on a Mac, of course.


Then, copy the generated public key into the .ssh directory in the home directory of the account on Linux that you wish to login to. You should then be able to log in without a password.

Jul 15, 2012 11:48 PM in response to etresoft

Thanks for the login without a password tip, etresoft. That I will now follow up.


As far as the stas go, my FAH experience is as follows:


From the 15th of April (this year) until the 26th of June, my iMac processed 47 work units amassing a total of around 77k points. At that point I stopped using the iMac because I'd got my home build (my 'Umac') up and running with FAH.


From the 25th of June unti today, 16th of July, my Umac has processed 191 work units for a total of around 420k points (this doesn't include any points from the iMac's contributions).


Whether you count work units or points or some weighted average of the two, the Umac has it over the iMac, plus I'm saving the iMac, a more expensive, family machine, from any strain due to high temperatures.

Jul 16, 2012 5:56 AM in response to Rod Fryer

But that is because you are using the Mac. My theory is that if you replaced the Linux machine with a Mac, you would get even more performance. I work with Linux machines every day and I don't think they are that fast at all. Sure the Linux server runs faster than my MacBook Pro, but it has 64 cores to my 2 cores and 128 GB RAM to my 4 GB. Is it 32 times faster? No way. Does the Linux machine lock up and need a reboot once a week - yep.

Jul 16, 2012 6:35 AM in response to etresoft

This is interesting.


But I still don't understand quite.


I have an Intel iMac core 2 Duo, 2.4 GHz, with 4 GB memory. In Activity Monitor, FAH CPU usage always stood at somewhere between 195 and 200% (I never saw it actually reach 200% of course). The temperatures always required watching. It ran hot. It typically managed 1 FAH work unit roughly every 27 hours, for around 1k-1.5k points.


The Ubu machine (the Umac) has an Intel Core i7 2600k processor, 3.4 GHz, and 4 GB memory. It has 4 cores. Its core temperatures are very acceptable, and it's fast. It manages FAH work units in a variety of lengths, but generating anything from 20k-30k in points per day.


I basically built the Umac as a 'sacrificial processor' in order to save our iMac from getting over-stressed with heat. It's purely and simply a workhorse. The iMac has generally light-to-moderate use - WP, the odd bit of spreadsheeting, databasing, watching DVDs, using GarageBand with a midi keyboard hooked up, iTunes. I didn't want to beat it to death with FAH once I found out the nature of the workload. I was able to build the Umac for roughly two-thirds of the cost of the cheapest quoted replacement iMac. Were we to replace our current iMac, we wouldn't be buying the lowst priced version - middle of the range and slightly up is where I generally shop.


Our iMac is rock stable and so far the Umac has been a stellar performer. it's never alerted me of the need to reboot so far, after 3 weeks of continuous use. I like Ubuntu for my purpose as well. That's not to say I'd opt for a Linux machine over a Mac as a general home-use machine - I'd always go for a Mac. But a Mac is far too special to flog hard in my book. 😉

Jul 16, 2012 7:23 AM in response to Rod Fryer

To be fair to my Linux system - it is about as souped up as they get. It has 64 cores and they get used. It saturates its 10 Gbit ethernet. Still, the amount of data I have to process with it requires overnight to run. Something flakes out in the fancy hardware drivers and causes it to lock it. That isn't typical Linux behaviour.


As for the iMac, there is nothing wrong with running it hard. That is what the fans are for. It is designed for style over cooling, obviously. An i7 machine is much faster than a Core 2 duo. That isn't a fair comparison. An equivalent Mac would also be a stellar performer, rock solid, look great, and run Microsoft Word.

Jul 16, 2012 11:23 AM in response to Rod Fryer

Thanks for your long reply. I'm sorry to say that I don't really understand most of the technicalities in it. I have an extremely limited exposure to this so far, and have learned a few tricks to achieve what I want.


FWIW, you're playing in the proverbial deep end of the pool here. The shell can be quite unforgiving of certain sorts of mistakes, too.


Although in my first post I set out the command ssh -X user@user-etc, I can achieve the same effect that I want (or so it seems) by simply typing ssh user@user-etc.

For instance, the command sensors works with or without the -X.

Similarly, I can update and/or upgrade the software by issuing the appropriate commands (via aliases I created), with or without the -X.


With the -X (or -Y), ssh is intending to tunnel X Windows sessions, and (to function) the ssh -X (or -Y) command is issued from an X11.app Xterm environment. If you're not using remote X displays tunneled via ssh, then you don't need -X (or -Y) here, nor do you need X11.app for that matter.


Basically, I'm happy to acquire the few commands I need to carry out a limited number of tasks.


I'd spend a little time with the bash beginner's intro and related materials including the shell-scripting intro. If you're going to be using Terminal.app on OS X or managing a Linux box with the command line, you'll need some grounding in bash and related.


What I'm wondering, is whether I can shortcut the whole login process after the prompt, and do away with the need for a password.


That's what I was referring to in that reply, and in the linked ssh no-password article. (I don't have an article covering connecting to Linux, unfortunately. There are undoubtedly a few posted around the 'net, however.)


In general, you can get to a no-password login by setting up the certificate keys appropriately. ssh can use what is called a public-private key-pair, and the public key can be, well, public. The private key must be maintained like a password; privately. You first create a key-pair on OS X as described in the article, or from various other resoures around the 'net. With the private key kept on your local system (again, as described in the article) and with the public key transferred over onto the Linux system (and into its ssh directories), you will get an automatic login, or you'll be prompted for the passphrase associated with the key-pair. This passphrase is associated with the key-pair, and is not your login password.


There are other ways to do a no-password login including as setting up Open Directory and Kerberos on your local network, but those are more involved than setting up an ssh key-pair. Those are going to be more effort to set up.


ARD, screen sharing or CoRD are the other options, and entirely avoid the command-line, assuming the Linux box has RDP server capabilities configured.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Connecting to Ubuntu machine from PowerBook

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.