Question

I migrated from Windows 7 to OSX. I am trying to recreate the functionality of "net use" on the Mac via Terminal. Problem is the machine I want to mount has no shares.

In Windows7 I could map the drive and have full access via:

 net use \\address\C$ /USER:user pass

Is there no bash method similar to this this?

rmdir /Volumes/test
mkdir /Volumes/test
mount_smbfs //user:pass@address/ /Volumes/test

Finally realized that the no shares was cause of my problem with that mounting.

Was it helpful?

Solution

You probably missed the C$ part.

mount_smbfs '//user:pass@address/C$' /Volumes/test

Quoting ('') may not be necessary since $ does not follow a parameter name but let's just be explicit.

You also need to add your username and password:

mount_smbfs '//user:pass@address/C$' /Volumes/test -o user='user',pass='pass'

Sometimes it doesn't work due to many causes I don't technically know but you can also try:

mount -t smbfs '//user:pass@address/C$' /Volumes/test -o user='user',pass='pass'
mount -t smbfs '//user:pass@address/C$' /Volumes/test -o username='user',password='pass'
mount -t cifs '//user:pass@address/C$' /Volumes/test -o user='user',pass='pass'
mount -t cifs '//user:pass@address/C$' /Volumes/test -o username='user',pass='password'

See Mounting samba shares from a unix client.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top