Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2400028
  • 博文数量: 328
  • 博客积分: 4302
  • 博客等级: 上校
  • 技术积分: 5486
  • 用 户 组: 普通用户
  • 注册时间: 2010-07-01 11:14
个人简介

悲剧,绝对的悲剧,悲剧中的悲剧。

文章分类

全部博文(328)

文章存档

2017年(6)

2016年(18)

2015年(28)

2014年(73)

2013年(62)

2012年(58)

2011年(55)

2010年(28)

分类: iOS平台

2016-01-28 21:55:35

SSH (or Secure Shell) is a great service to enable on your Mac at home or work. This useful tool not only enables the ability to remotely access the command line interface of your Mac, but also to remotely access your files through a secure FTP (SFTP) connection, which gives you the ability to transfer files at will. Read on to find out how to transfer files between your own computers over a secure network connection using any modern FTP program.


What You’ll Need:

>> Mac
>> Router with Port Mapping feature (we’re using an AirPort Extreme)
>> SSH or Terminal app to access command line (We’re using the built-in Terminal app)
>> SFTP/FTP client (We’re using Transmit from Panic)

1. Get a Static IP Address on your Mac

The first step to setting up these web services on your Mac is specifying a static IP address on the Mac you’ll be connecting to. Because we’ve covered this step multiple times, we’ll point you to an article we  that clearly outlines the process of setting up a static IP address. Follow the steps , then come back here to finish setting up SSH on your Mac.

2. Enable SSH on your Mac

Next, we’ll enable SSH on the Mac you’re going to be accessing remotely. Navigate to System Preferences > Sharing.


Once there, check the Remote Login box to enable SSH, then select the radio button labeled “All Users” from the Allow Access For section. This will in turn enable SSH for every user on the Mac. If you wish to, you can enable SSH only for select users using the other options.


3. Configure Port Mappings

Port mapping is another topic that we covered in the past. Follow the directions , while making the following changes when it comes to specifying the ports.



When opening the Port Mapping Setup Assistant (located in AirPort Utility > Manual Setup > Advanced > Add, select “Remote Login - SSH” from the Service drop-down menu. The Public and Private TCP Ports should automatically be filled in as 22. This is the default port number for SSH. The only other field that needs to be filled in is the Private IP Address. Place the Static IP Address of the Mac that you enabled SSH on. 

This setting will tell the router to forward any SSH traffic (on port 22) to the Mac that you enabled SSH on.


4. Access your Mac remotely via Command line

Now that you’ve enabled SSH and configured port mapping on your router, you will be able to access your Mac’s command line and files remotely.


Open the Terminal app (/Applications/Utilities/), and type the following command, supplementing the underlined items with your own data. Note, you can find the IP Address of your Internet connection by visiting a site like 

ssh Username@IPAddress

After entering the above command (with your info provided), press the enter key. You will then be prompted for your account password. After you have authenticated with your password, your SSH session will be opened and be able to interact with your Mac’s command line just as though you were sitting in from of your computer. 


5. Access your Mac’s files remotely via SSH

With an SFTP client (like , or ), you can quickly access your files remotely thanks to SSH on your home or work Mac. We’re going to show you how to do the following steps using Transmit.


After opening Transmit, go to Go > Connect To... > SFTP Server. Fill in the Server, Username, and Password fields. The server should be the IP Address that you got from  on the Mac with SSH enabled, the username and password will be the account on the Mac you’re connecting to.



After you click connect, you will be browse, download, and upload files to your Mac remotely. 


Repost from 
阅读(1519) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~