将您的 Mac 连接到本地或远程服务器(Connecting your Mac to a local or remote server)允许您访问该特定服务器上的所有可用文件。默认情况下,macOS 具有服务器连接功能,可让您将Mac连接到任何服务器而不受任何限制。然后,它在Finder(Finder)中显示为普通磁盘驱动器,供您访问、使用甚至删除文件。
有多种方法可以将服务器作为存储安装在您的计算机上。您可以使用 macOS 内置的本机功能,甚至可以使用第三方应用程序访问您Mac上的服务器。
如何使用 Finder 连接到 Mac 上的服务器(How to Connect to a Server on a Mac Using The Finder)
使用Finder建立与服务器的连接是完成该任务的最简单、最快捷的方法。您需要做的就是在您的Mac上启动一个选项,输入您的服务器详细信息,然后您就可以开始了。
将您的服务器登录详细信息放在手边,因为您将在以下步骤中需要它们。
- 在Mac(Mac)上打开Finder窗口。最简单的方法是前往您的桌面(Desktop),您将进入Finder窗口。
- 单击窗口顶部的Go菜单,然后选择Connect to Server选项。或者,按Command + K 键盘快捷键。
- 您将看到一个对话框,您可以在其中输入服务器详细信息,然后连接到它。将光标放在显示服务器地址(Server Address)的字段中,然后输入服务器的地址。这可以是URL或 IP 地址。然后单击“连接(Connect)”按钮以连接到指定的服务器。
- 将出现一个提示,要求您输入登录详细信息。输入详细信息,它会将您连接到服务器。
连接后,您的服务器将在Mac上显示为普通磁盘驱动器。您可以双击此驱动程序以访问其内容,甚至可以从您的 Mac 添加新文件(add new files from your Mac)。
玩完服务器后,您可能想断开与它的连接。您可以通过右键单击服务器并选择“弹出(Eject)”选项来执行此操作。
它将从Mac上的Finder中删除。
如何在 Mac 上连接到最近的服务器(How to Connect To Recent Servers On a Mac)
当您使用Finder连接到Mac上的服务器时,您的Mac会将服务器名称保存在系统上。这是为了帮助您稍后连接到它,而无需您重新输入服务器详细信息。
(Finding)在Mac上(Mac)查找和连接到最近的服务器可以通过两种方式完成。
使用 Apple 菜单连接到 Mac 上的服务器(Use The Apple Menu To Connect To a Server On a Mac)
Mac上的Apple菜单可让您打开最近访问的项目,这也包括您的服务器。
- 单击(Click)屏幕左上角的Apple标志,选择“(Apple)最近的项目(Recent Items)”选项,您将在列表中找到所有最近连接的服务器。
使用连接到服务器菜单连接到最近的服务器(Use The Connect to Server Menu To Connect To a Recent Server)
查找并连接到最近的服务器的另一种方法是使用与您最初用于建立连接的菜单相同的菜单。
- 进入(Get)Finder窗口,单击顶部的 Go 菜单,然后选择Connect to (Go)Server(Connect to Server)选项。
- 会有一个看起来像时间机器的图标。单击(Click)它,您将看到您最近的服务器列表。选择您要连接的服务器,您的Mac将连接到它。
使用 AppleScript 将 Mac 连接到服务器(Use AppleScript To Connect a Mac to a Server)
AppleScript 还具有一项功能(AppleScript also has a feature),可让您通过代码将Mac连接到服务器。这是一个单行代码,指示Finder在您的机器上打开您指定的服务器。
- 单击Dock 中的Launchpad,搜索Script Editor,然后在它出现在屏幕上时单击它。
- 单击顶部的文件菜单并选择(File)新建(New)以在应用程序中创建一个新脚本。
- 当新的脚本编辑器打开时,在其中输入以下命令。确保将SERVER替换为您的服务器的实际地址。
告诉应用程序“Finder”打开位置服务器(tell app “Finder” to open location SERVER)
- 单击顶部的脚本菜单并选择(Script)运行(Run)以测试您的脚本并查看它是否连接到您选择的服务器。
您可以保存脚本以供以后在Mac上使用。然后你所要做的就是双击文件,它就会建立连接。
如何使用 Cyberduck 连接到 Mac 上的服务器(How To Connect To a Server On a Mac Using Cyberduck)
如果您出于某种原因不喜欢连接到服务器的默认选项,那么您不会被绑定到它,您可以使用市场上可用的任何第三方应用程序来完成您的任务。
Cyberduck是帮助您连接各种服务器的免费应用程序之一。您可以使用它从您的Mac(Mac)连接到FTP、SFTP、WebDAV、Amazon S3和各种其他服务器。
- 在您的 Mac 上下载并安装Cyberduck应用程序。(Cyberduck)
- 启动应用程序并单击显示Open Connection的选项。它会让你连接到服务器。
- 在接下来的屏幕上,选择您的服务器类型,输入您的服务器地址,输入登录详细信息,然后单击连接(Connect)。
如果您将来还要连接到此服务器,请确保选中添加到钥匙串(Add to Keychain),以便下次连接时自动填写您的登录详细信息。
How to Connect to a Remote or Local Server on a Mac
Connecting your Mac to a local or remote server allows you to access all the files available on that particular server. macOS by default has a server connection feature that lets you connect your Mac to any server without any restrictions. It then appears as a normal disk drive in the Finder for you to access, work with, and even delete files from it.
There are multiple ways to mount a server as storage on your machine. You can do it using the native feature built into the macOS and you can even use a third-party app to access your servers on your Mac.
How to Connect to a Server on a Mac Using The Finder
Using the Finder to establish a connection to a server is the easiest and quickest way to do the task. All you need to do is launch an option on your Mac, enter your server details, and you’re good to go.
Keep your server login details handy as you’re going to need them in the following steps.
- Open a Finder window on your Mac. The easiest way to do it is to head to your Desktop and you’ll be inside a Finder window.
- Click on the Go menu at the top of your window and select the option that says Connect to Server. Alternatively, press the Command + K keyboard shortcut.
- You’ll see a dialog box that lets you enter your server details to then connect to it. Put your cursor in the field that says Server Address and type in the address of your server. This could be a URL or an IP address. Then click on the Connect button to connect to the specified server.
- A prompt will appear asking you to enter your login details. Enter the details and it’ll connect you to the server.
Once you’re connected, your server will appear as a normal disk drive on your Mac. You can double-click on this driver to access its contents and even add new files from your Mac.
When you’ve finished playing around with the server, you might want to disconnect from it. You can do it by right-clicking on the server and selecting the Eject option.
It’ll be removed from the Finder on your Mac.
How to Connect To Recent Servers On a Mac
When you connect to a server on a Mac using the Finder, your Mac saves the server name on your system. It is to help you connect to it at a later time without having you re-enter the server details.
Finding and connecting to recent servers on a Mac can be done using two ways.
Use The Apple Menu To Connect To a Server On a Mac
The Apple menu on your Mac lets you open the recently accessed items and this includes your servers as well.
- Click on the Apple logo at the top-left corner of your screen, select the Recent Items option, and you’ll find all your recently connected servers in the list.
- Click on any of the servers and you’ll be connected to them.
Use The Connect to Server Menu To Connect To a Recent Server
Another way to find and connect to a recent server is to use the same menu that you used in the first place to make the connection.
- Get inside a Finder window, click on the Go menu at the top, and select the Connect to Server option.
- There’ll be an icon that looks like a time machine. Click on it and you’ll see your recent servers list. Select the server you want to connect and your Mac will connect to it.
Use AppleScript To Connect a Mac to a Server
AppleScript also has a feature that lets you connect your Mac to a server from your code. It’s a single-line code that instructs the Finder to open your specified server on your machine.
- Click on Launchpad in the Dock, search for Script Editor, and click on it when it appears on your screen.
- Click on the File menu at the top and select New to create a new script in the app.
- When the new script editor opens, type the following command into it. Make sure to replace SERVER with the actual address of your server.
tell app “Finder” to open location SERVER
- Click on the Script menu at the top and select Run to test your script and to see if it connects to your chosen server.
You can save the script to use at a later time on your Mac. Then all you’ll have to do is double-click on the file and it’ll establish the connection.
How To Connect To a Server On a Mac Using Cyberduck
If you don’t like the default option to connect to a server for some reason, you aren’t tied to it and you can use any of the third-party apps available in the market for your task.
Cyberduck is one of the free apps that helps you connect to various kinds of servers. You can use it to connect to FTP, SFTP, WebDAV, Amazon S3, and various other servers from your Mac.
- Download and install the Cyberduck app on your Mac.
- Launch the app and click on the option that says Open Connection. It’ll let you connect to a server.
- On the following screen, select your server type, enter your server address, type in the login details, and click on Connect.
If you’ll be connecting to this server in the future as well, make sure to checkmark Add to Keychain so your login details are automatically filled in the next time you connect to it.