The MacValley blog

 

Welcome to the MacValley blog, your first stop for all the latest MacValley news and views.

 

Tom Briant

The MacValley blog

Editor: Tom Briant

 

Click here to email Tom

Click here for Tom's profile

 

 

To search the blog posts please use the box below

Saturday, March 4, 2017

How to successfully network between macOS 10.12.3 and Ubuntu Linux 16.04 Part I from the Mac to Ubuntu Linux

If you have tried to network between a computer running Ubuntu 16.04 and a Mac running macOS 10.12.3, you’ve probably hit a wall.

You set up Windows style SMB networking in the Sharing preference pane by clicking on the File Sharing box in the Sharing Preference Pane

You can see an icon for your Mac in your Linux file manager for File Sharing.

You click on that icon and you get a request for your user name and password. Over and over and over.

So you thought, “Well, I’ll go the other way and activate file sharing on the Ubuntu machine to network back to the Mac.” You did all the steps and still hit a dialog box which told you that you entered the wrong password. Over and over again.

Urrgh! And I’m sure much worst language, as well.

Well, it’s not you. It’s not your computers. It’s the simple facf that the way SMB networking works on the Mac and the way it works on the Ubuntu Linux have changed. They have diverged and become INCOMPATIBLE. So it’s not going to work until you take radical action. And I don’t know what the heck that radical action would be.

Yes, I tried the SMBUp donationware program to replace Apple’s implementation of SMB with plain vanilla Samba. The installer downloaded, but the installation failed twice under macOS 10.12.3

Finally, I found an answer. This is the key phrase to remember:

Forget using SMB and switch to SSH and SFTP.

 

The implementations of SSH (Secure Shell) and SFTP (Secure File Transfer Protocol) to connect computers for both macOS and Ubuntu Linux are fully compatible.

Here’s how to do it between your Mac and your Linux machine:

Step One: On your Mac, pick the folders you wish to share. If you have folders within those folders that you want to share, too; that’s fine. Just pick the overall folder, like your Music or Documents or Pictures folder.

Now view these folders in your Finder. Right-click/control-click on each of them in turn. Click on Get Info.

 

Share Pictures folder from Mac Step 1

 

Choose to share the folders. This will cause the File Sharing box in the Sharing Preference Pane to receive a check mark and turn it on. Do not turn off File Sharing, as you will need it later!


Unshared folder before proceass Step 2

 

 

Shared folder with checkmark

 

File Sharing ON


 

Step Two: Go back to the Sharing Preference Pane on your Mac. You want Remote Login. You will see a message telling you how to log back into your Mac from another computer using SSH.

Remote Login on Mac OFF

 

Remote Login ON

 

You’ve set up your Mac. Now go over to the Ubuntu Linux machine.

Go to the File Manager.

 

In stock Ubuntu, the File Manager is called Nautilus. The icon for it looks like an open file cabinet. It’s in the upper left-hander corner. Click on it.

Highlight from Ubuntu of Nautilus file manager

 

 

On the left-hand sidebar, go down until you see Network. Click on it. You should see an icon for the Mac. Indeed, you should see several icons for the Mac.

 

Nautilus file manager showing several Mac icons

 

 

Click on Network to see al the computers hooked up to your Ubuntu machine. You should see several entries for your Mac. One is just the computer. Another two or three are for your Mac followed by parentheses (File Sharing).

The one you want to start with is your computer’s name followed by (Remote Login). Double-click on it.

 

Nautilus file manager showing warning for first time log in

You’ll get a warning that your Ubuntu machine doesn’t recognize your Mac and that you should really contact your System Administrator to make sure it’s OK>

As you are the System Administrator, double-click on the button “Login Anyway” Now you get a dialog box asking for your user name and password. Notice that it does not have the middle entry for Workgroup that previous boxes of this type showed when you used SMB File Sharing. This is a sign that you are on the right path.

 

Nautilus File Manager showing Remote Login two line dialog to log in

So enter your Mac user name and Mac administrative password and press ENTER. You should see a display of your Mac’s file system with all sorts of UNIX folders you don’t normally see. That’s OK, you’re looking at the root of the Mac’s file system. Just maneuver down to Users (not usr) and double-click.

Nautilus file manager showing all folders in root of Mac

 

 

 

Now you see the various user accounts you have set up. You can enter the folders that you set up as file sharing because you gave them the file permissions to share with the world.

Nautilus file manager showing my four user accounts

 

Nautilus file manager showing my folders in thomas briant

 

 

 

Now for the File Sharing icons.

Click on them in succession. If you get a dialog box with User Name, Workgroup, and Password, that means you haven’t got the right one. Go on to the next one until you get a two line dialog box with just User Name and Administrative Password. This is the one you want.

Nautilus file manager showing UNSUCESSFUL log in attempt with three line dialog box

 

Nautilus file manager showing SUCCESSFUL log in

 

Enter your user name and administrative password, then click on OK. You should finally see the icons of the shared folders.

 

Nautilus file manager showing only SHARED folders with network folder icons

What went right this time?, you ask. Well, you will not use the SMB networking protocol. You will use AFP, Apple Filing Protocol, over Secure File Transfer Protocol. You set up Secure File Transfer Protocol when you set up the Remote Login. Now you will use Apple Filing Protocol.

Some Caveats.

 

Now SSH is designed to network two and only two computers securely. While it’s possible to network more than two computers using SSH, you’d need a server setup for that.

I’ll show you how to network between your Ubuntu Linux machine back to y our Mac using two methods in the second installment. Both work, but one takes less time.

 

I’ll show you a simple way to network two or more computers in the third installment. For right now, you’ve networked two computers, a Mac and a Linux machine, together securely.

I’ll get into the steps necessary to perform if you want to network a different Mac here.

The known hosts file that specifically identified your Mac as the server to log into is in a hidden folder called. “.ssh” You need to remove that folder and file before you can set up a different computer as the server. Note that all hidden files and folders are preceded by a dot. 

Nautilus file manager showing how to view hidden files and folders

To do so, go under the View menu for the Files app, whose icon looks like an open file drawer at the top of the list of icons. Click on “Show Hidden Files” and a lot of hidden folder and files will appear in the HOME folder.

Nautilus file manager showing all folders and file

 

You right-click on .ssh and select Move to Trash. That’s it. Now you can use the new computer to log in.

 

Nautilus file manager showing MOVE TO TRASH option

 

 

Now go back through the steps I outlined above to set up a new Mac for file sharing.

 

Problem solved from Mac to Ubuntu. 

 

Tom Briant

Editor, MacValley Blog

No comments:

Post a Comment

 

 

Blog Archive