HomeMacHow one can Mount SMB Share from Command Line on Mac

How one can Mount SMB Share from Command Line on Mac


Mac Terminal icon

Have to mount an SMB community share from the command line of MacOS? There are a couple of completely different approaches to mount SMB shares from the command line, and we’ll cowl two completely different strategies to mount community shares on the Mac utilizing Terminal.

Many customers depend on SMB for file sharing between Mac and Home windows PC or Linux, however SMB can be utilized by many Macs, so it’s possible you’ll discover a wide range of networking conditions the place you’d wish to mount an SMB share. When you can definitely hook up with and mount community shares by means of the Finder, many circumstances exist the place performing this motion from the command line is critical or useful.

We’re going to imagine you’re already accustomed to the command line sufficient to know a bit about Terminal, so launch the Terminal app from the /Functions/Utilities/ folder, from Highlight, or keyboard shortcut, and let’s start.

Mounting SMB Shares from Command Line on Mac with open

The ‘open’ command will mount an SMB file share in Finder of MacOS, however from the command line. The syntax to make use of is as follows:

open "smb://title@server/"

For instance, if the username was “paul” and the Mac server title was “M1-MacBook-Professional” the command would seem like so:

open "smb://paul@M1-MacBook-Professional/"

Hit return and also you’ll discover the Finder will launch to the community share, prompting you for the password if one is required.

Observe: when you’re trying to make use of SMB file sharing on a Mac operating MacOS Ventura, it’s possible you’ll run into error messages repeatedly until you observe this goofy repair for SMB file sharing in MacOS Ventura which requires you to show sharing off, reboot, then flip it again on once more. File sharing in Ventura is a bit buggy, so don’t be stunned when you encounter points with it.

Mount SMB Shares from Command Line on Mac with mount

The mount command additionally lets you mount a community share from the command line. This will likely be finished fully from the command line nevertheless, and it’ll not launch the Finder, not like the aforementioned open command.

The syntax to make use of with mount for SMB shares is as follows:
mount -t smbfs //title@server /MountDestination

For instance, if the consumer title is “Paul” and the pc title is “M1 MacBook Professional”, and your required vacation spot is ./mountedM1, the syntax can be as follows:

mount -t smbfs //paul@M1-MacBook-Professional ./mountedM1

Hit return and also you’ll should authenticate (assuming authentication is required) to attach.

You can too place the password within the command for mount, however for safety causes doing so just isn’t suggested, because it enters the password in plain textual content and leaves it in your command historical past.

Did you efficiently mount an SMB share from the command line of your Mac? Do you utilize one other method to mount SMB shares from the Terminal? Share with us within the feedback your strategies and experiences.



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments