• Updated 2023-07-12: Hello, Guest! Welcome back, and be sure to check out this follow-up post about our outage a week or so ago.

SSH into my BSD computer?

benjgvps

Well-known member
Is there any good software that I could use to SSH into my FreeBSD system with a Mac to PC null modem cable?

 

II2II

Well-known member
SSH requires a TCP/IP connection, which sounds overly complex if you just want to connect the two systems via a null modem cable to use one as a remote terminal.

The thing you want to setup is getty. This is usually already done for you, but you will want to check your /etc/inittab (or is it /etc/ttys for FreeBSD) to see what the communications parameters. You would then use a program like ZTerm on the Mac to access FreeBSD on your PC.

 

benjgvps

Well-known member
When I try to connect with MacSSH I get an error:

An error occurred while attempting to open

the MacTCP driver.

Internal error #300

MacOS error #-23

I cannot find any way to connect with Zterm.

 

Anonymous Freak

Well-known member
To verify, SSH is an "internet protocol". It does not work over a straight serial connection. Period. (It can be made to work by setting up PPP, but that is way beyond the scope of what you want.)

To verify: What you really want is a way to connect via serial cable from one computer to another, accessing a command prompt?

If that is the case, then you need to set up a serial terminal server on the BSD machine (II2II suggests getty, which is usually fine.) Then a serial terminal client (such as ZTerm) on the classic Mac OS machine.

The way to connect in ZTerm is to open a serial connection, with the baud rate the BSD machine is expecting. Generally, this defaults to 9600 baud. (And if it asks for other info, it is usually "N/8/1", or "N, 8, 1", or some such. I'm not going to explain what that all means, because as long as you pick the right setting, it doesn't matter.) If 9600 baud doesn't work, try 57600, then 19200, then 2400. You'll know it doesn't work because when you try to type something into the terminal window, you will get gibberish in reply.

On to the technical explanation: There are two different approaches at play here. One is "raw serial", which is a straight stream of 1s and 0s over a cable directly between two computers. The other is a TCP/IP (internet) data stream, which is a bunch of packeted data, not the raw stream of 1s and 0s. This TCP/IP connection can occur over a variety of interfaces, including Ethernet, WiFi, and even serial. But the serial connection has to be configured, generally as "PPP", which for a raw null-modem connection, requires quite a bit of setup on both ends. MacTCP is complaining because it is not set up for a PPP connection.

Your best bet really is Zterm. (Unless you have another computer on the same local Ethernet or WiFi network as the BSD machine, in which case SSH should work fine. You would just connect via SSH to the IP address of the BSD machine, ignoring the serial cable altogether.)

 

pee-air

Well-known member
You cannot connect with MacSSH over the serial port. You'll have to use ethernet. Does your BSD box have an ethernet card? Does your Mac have an ethernet card? Do you have a hub/switch or crossover cable?

Using Zterm to connect to another machine over a null modem cable is easy. You just have to make sure that both machines are configured the same for serial communications. Set the baud rate, parity, stop bit, etcetera so that they match on both machines. Then just go to your 'Connection' (???) menu in Zterm and select 'Direct Connect'. You may have to press 'Enter' once or twice for something to appear on your screen.

I use Zterm to connect to my headless SGI box through the serial port. It works rather well and is very easy to configure. Like II2II said, you may have to pay a visit to your /etc/inittab file and look for something like this:

Code:
#T0:23:respawn:/sbin/getty -L ttyS0 9600 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
That's a snippet from my /etc/inittab file in Linux. I have them commented out because I don't use a getty on the serial port of my Linux box. If I did though, I would uncomment the first line and chage the 9600 to 38400 or higher. So it looked like this:

Code:
T0:23:respawn:/sbin/getty -L ttyS0 38400 vt100
#T1:23:respawn:/sbin/getty -L ttyS1 9600 vt100
 

benjgvps

Well-known member
To verify: What you really want is a way to connect via serial cable from one computer to another, accessing a command prompt?

If that is the case, then you need to set up a serial terminal server on the BSD machine (II2II suggests getty, which is usually fine.) Then a serial terminal client (such as ZTerm) on the classic Mac OS machine.
I want to access the command prompt. I will take a look at getty. I should of said this at the start, I am trying to connect with my PowerBook 150 to my BSD based Freenas, which has an Ethernet card.

pee-air:

How would I go about setting up "baud rate, parity, stop bit, etcetera" on a BSD machine?

 

pee-air

Well-known member
pee-air:

How would I go about setting up "baud rate, parity, stop bit, etcetera" on a BSD machine?
I wouldn't worry about it. The defaults should be fine. It should default to 8 data bits, no parity, and 1 stop bit. The only thing you need to chage is the speed. I'd recommend 38400 for a 68K Macintosh like your Powerbook. Just make sure that Zterm is configured for 8 data bits, no parity, and 1 stop bit. Select 38,400 baud (or whichever speed you choose) and make sure that flow cntrol is off. Uncheck hardware handshaking if it's enabled, and disable xon/xoff if it's enabled. It's pretty straightforward.

For more info about getty or inttab, do a man getty or man inittab from your BSD box. Or, you can get these man pages online with a quick Google search.

 

Anonymous Freak

Well-known member
Again, benjgvps: both methods get you a command prompt. It all depends on if you want to use Ethernet or serial cable.

If Ethernet (which means your PB150 would need some form of Ethernet,) then SSH is fine.

If serial (which would mean that your FreeNAS needs to have a serial port,) then you need a serial terminal (such as ZTerm.) The fact that you are using an older PowerBook means that I would keep the baud rate at 9600. (Fast enough for a command line.) In pee-air's examples, the number shows the baud rate. (His show both 9600 and 38400.) The parity, bits per character, and stop bit (the "N, 8, 1" parts I mention,) should be set at no parity, 8 bits per character, and 1 stop bit, (again, "N, 8, 1") by default on a modern BSD machine.

All you'll need to specify on the BSD machine is baud rate. And in ZTerm on the PowerBook, make sure you specify the same baud rate.

 

benjgvps

Well-known member
Well I got it up and working! Thank you guys! I just have an easy question, How do I stop commands? Like if I ping somewhere, It keeps on pinging untill I reboot the machine. How do I stop it?

EDIT: I did it through the serial cable.

 

pee-air

Well-known member
So is there going to be a tutorial in your immediate future? ie. are you going to write one?

 

II2II

Well-known member
Just to clear up an earlier comment, Anonymous Freak is correct in saying that you can run SSH over a serial cable if you use TCP/IP over that cable. PPP is one option. SLIP is probably easier for home setups.

 

benjgvps

Well-known member
I might write a tutorial, It is just mostly info from different sites mixed in with your help. I also want to setup PPPD on the FreeBSD machine and use FreePPP on the PowerBook to connect to the internet. Someone here wrote a very brief explanation of what they did on a Mac OS X machine (http://68kmla.org/forums/viewtopic.php?t=1393) but did not give detail, I also bet he is long gone as he only made a few posts last year. I am trying tp enable PPP kernel support at the moment.

 

Anonymous Freak

Well-known member
Just to clear up an earlier comment, Anonymous Freak is correct in saying that you can run SSH over a serial cable if you use TCP/IP over that cable. PPP is one option. SLIP is probably easier for home setups.
heh. Back in the day, a friend and I were the first commercial SLIP customers in Portland, Oregon.

There were three commercial ISPs, all of which offered command-line only service. A friend and I wrote to the ISP we had an account with, asking them to install SLIP. They did. We promptly got a dial-up SLIP connection up and running, complete with NCSA Mosaic 1.0. Probably the first home users in Portland to browse web pages at home who didn't have a work-provided connection. (I'm sure there were others who had done it through their work before us.)

 

benjgvps

Well-known member
By any chance has anyone here dealt with Freenas, I need to edit the kernel config file to add ppp support, but I cannot find it!

EDIT: When I try to run the "pppd" command, it tells me:

Code:
freenas:~# pppd
pppd: This system lacks kernel support for PPP.  To include PPP support
in the kernel, please add "device ppp" to your kernel config or
load the if_ppp module.
I cannot add "device to the kernel config because I cannot find it. I have no idea how to load the module and cannot find any info on it.

 

pee-air

Well-known member
Google is your friend. When I did a search on "FreeBSD pppd" the first hit was a howto configure FreeBSD as a ppp router. Exactly what you're trying to do.

That's all of the help I can provide. I don't use FreeBSD.

 

benjgvps

Well-known member
I saw that one, the problem is, that is for FreeBSD 2.05. I cannot find anything about how to set it up on version 6.2.

 
Top