EzDevInfo.com

smb interview questions

Top smb frequently asked interview questions

how do I connect to an smb share?

I apologize if this is a stupid question.

I have a smb share set up (smb://a.b.c.d/sharename) that I am attempting to connect to from windows. I'd like to either connect directly using a browser or mount the share to a virtual drive. The problem is I can't seem to get it to work properly. Can anyone let me know how this works?

I'm running Windows 7 64-bit


Source: (StackOverflow)

How to access C$ share in a network?

Considering I have admin access to a machine, how can I remotely access the default C$ share in Windows XP and Windows 7?

Edit: This is not a domain, it's a single machine that I need to access


Source: (StackOverflow)

Advertisements

Accessing a Windows share with a different username

Is it possible to manually specify the username Windows uses when it connects to a networked share?

perhaps \\username@host\...

Both the server and clients run Windows 7.

Thank you!


Source: (StackOverflow)

How do I have a network share mount in Mac OS X persist between reboots

I currently connect to a Windows (smb) share via the Finder -> Go -> Connect To Server. I have to type in the IP (although I have saved the credentials in my keychain). If I reboot or logout, I have to do this again.

I would like the SMB share I am connecting to always be available as soon as I login. How can I accomplish this?


Source: (StackOverflow)

Cant open file for writing with cifs mount

Hi I have mounted my QNAP on to a drive on my ubuntu machine using the following fstab entry

//<ip-address>/Documents/Aly /home/aly/Documents cifs credentials=/root/.credentials,uid=1000,gid=1000,rw,hard,dir_mode=0777,file_mode=0777 0 0

this gives the following permisssions:

drwxrwxrwx  1 aly aly    0 2011-12-03 12:18 .
drwxr-xr-x 13 aly aly 4096 2011-12-03 12:14 ..
-rwxrwxrwx  1 aly aly    5 2011-12-03 11:55 test.tst
drwxrwxrwx  1 aly aly    0 2011-11-26 17:54 VirtualBox VMs

I have permissions to delete files and add files, however when trying to write to a file i.e. test.tst I get the following error in vi:

"test.tst" E212: Can't open file for writing

Has anyone seen this before, if i mount the drive via nfs this is not an issue, however nfs lacks the security i desire.

EDIT

The solution I have come to is:

<ip-address>:Documents/Aly/ /home/aly/Documents cifs hard,noperm,nouid,credentials=/root/.credentials,iocharset=utf8,file_mode=0777,dir_mode=0777,nodfs 0 0

Source: (StackOverflow)

Accessing X$ share on a personal computer

I need to access some of my hard drives on my desktop PC from my laptop without setting a public share folder. I run Windows 7 Ultimate on both

When I try to connect to \mycomputer\e$ it asks me for password (it's OK), but when I type "MYCOMPUTER\DJ Echelon" as user name and my local admin password it refuses to log in.

I usually use this way of logging in (with my company's domain) when accessing my work laptop's hard drive, and it works. I simply specified the domain name only because Windows wants me to log in inside my laptop's domain (which actually is not a domain, Windows just says "Domain: MYLAPTOP" so I tried to replace it).

What am I missing?

Thank you


Source: (StackOverflow)

Force Finder to log in as Guest to a SMB share

I have a QNAP NAS that offers a few SMB shares. As I'm in a trusted environment, my shares are accessible as guest rather than with a combination of username and password.

Problem

Now, when I click the name of the device in Finder's sidebar, I get the black "Connection failed" bar, with the option "Connect as...". When I click that, I receive:

enter image description here

I can however press  + K and enter the server's name manually, which gets me to this window:

enter image description here

Here, I have to select "guest". Now, I can select one of the shares to connect to, and I'm finally connected to the server. If I select it in the sidebar, I get a list of all shares available, because I'm connected as "guest", obviously:

enter image description here

What I need

Well, as soon as I unmount all shares, I have to go through the same procedure of manually logging in as "guest" again, which I find quite annoying.

Is there any way I could get Finder (or the underlying SMB client) to know which credentials to use?

Or should I look for the solution rather on the server side? (I know that other SMB shares seem to work fine in my network)

Diagnostics

The only thing I can get out of Console.app is:

5/15/11 7:36:40 PM  /System/Library/CoreServices/Finder.app/Contents/MacOS/Finder[200]  SharePointBrowser::handleOpenCallBack returned 64

This message occurs when I click the name of the SMB server in the Finder sidebar.

Here's the output of `smbclient -L meredith -U guest -d=2

charon:~ werner$ smbclient -L meredith -U guest -d=2
added interface ip=192.168.100.11 bcast=192.168.100.255 nmask=255.255.255.0
tdb(unnamed): tdb_open_ex: could not open file /private/var/samba/gencache.tdb: Permission denied
Got a positive name query response from 192.168.100.100 ( 192.168.100.100 )
Password: 
Domain=[MEREDITH] OS=[Unix] Server=[Samba 3.5.2]

    Sharename       Type      Comment
    ---------       ----      -------
    music           Disk      
    movies          Disk      
    photos          Disk      
    software        Disk      
    archive         Disk      
    backups         Disk      
    IPC$            IPC       IPC Service (NAS Server)
Got a positive name query response from 192.168.100.100 ( 192.168.100.100 )
Domain=[MEREDITH] OS=[Unix] Server=[Samba 3.5.2]

    Server               Comment
    ---------            -------

    Workgroup            Master
    ---------            -------
    WORKGROUP            MEREDITH

Also, things I've tried:

  • There is no relevant entry in the Keychain (but why would it, I'm only connecting as guest)
  • Connecting with user name "Guest" and empty password logs me in but still after ejecting the last share, I get the same "Connection failed" error as before. The appropriate entry is made in the Keychain but obviously has no effect.

Keychain


Source: (StackOverflow)

What is going on when I can't access an SMB server share (not accessible error) until I run cmdkey to delete the credential?

I have a network connection share issue. The first connection works, and seems to stay connected for at least a few hours. However, after each time my windows 7 PC reboots, it can no longer form a network connection to the shared folder, nor browse to it, until I not only unmap and remap the mapped drive, but also, I have to use cmdkey to delete the stored credentials like this:

cmdkey /delete:Domain:target=HOSTNAME

My work PC is on a domain, and I am not the IT administrator, but I'm curious if there is anything I can do to investigate this issue. Any settings in registry or group policy that I could examine to see why the first connection works, but each subsequent attempt (once a stored credential exists) to browse or use the connection, fails with a connection error saying it is "not accessible", like this:

enter image description here

I do not even get any error until at least several minutes go by. THe first thing I see is a window frozen and empty, and then I get this error:

This has happened when connecting to a share on a DROBO device, and on a share which is not on the domain, but which was a Microsoft Home Server. I wonder if there's something broken in WIndows 7 professional with regards to connecting to non-domain shares when an active directory domain controller exists, and a particular workstation is joined to a domain?

The problem only occurs if I click "remember credentials". It is not fixed by any amount of working with net use. Usingcmdkey to delete all stored credentials for the host is the only way to get back in, and it affects all non-domain shared folders.

Update I'm hoping there are some registry locations I could check that could be misconfigured in some way that might explain why SMB/CIFS stored credentials for non-domain systems seem to be auto-invalidated in this weird way. Knowing how whacko Microsoft Windows domain and security handling is sometimes, this could be some kind of stupid "feature".


Source: (StackOverflow)

Install MC with SMB support

how to install MC (Midnight Commander) with Samba support (smb:// link like ftp). Im unable to install it thou apt-get. Ive got just mc version without smb. And install from sources failed. I try to google it, but no success.

Im on Ubuntu 11 (actually on XBMC 11, but its like Ubuntu). Thanks.


Source: (StackOverflow)

Drobo-FS config files exhibiting input/ouput error

I have a Drobo-FS with DropBear installed via DroboApps which allows me SSH access into the linux operating system which powers the Drobo-FS.

The Drobo-FS file system has a directory which looks like this

# ls /mnt/DroboFS/System
DNAS    avahi    netatalk    samba

Each of the directories listed has a conf or similar directory within it and for me the samba, netatalk and avahi conf files all exhibit an Input/ouput error

# ls /mnt/DroboFS/System/samba/conf
ls: /mnt/DroboFS/System/samba/conf/scratch.smb.conf: Input/output error
ls: /mnt/DroboFS/System/samba/conf/smb.conf: Input/output error

# ls /mnt/DroboFS/System/netatalk/conf
ls: /mnt/DroboFS/System/netatalk/conf/afpd.conf: Input/output error
ls: /mnt/DroboFS/System/netatalk/conf/AppleVolumes.default: Input/output error

# ls /mnt/DroboFS/System/avahi/conf
ls: /mnt/DroboFS/System/avahi/conf/scratch.avahi-daemon.conf: Input/output error
avahi-daemon.conf

I have read that this behaviour is indicitive of a hard-drive failure or a loose cable (I assume connecting the drive to the controller.) However this is not an ordinary Linux box, so my first question is

What device is /mnt/DroboFS/System stored on. I assume it cannot be on a hard-drive in any bay, and must therefore be on some other internal drive or flash memory. If so does this mean my Drobo-FS is faulty?

Also the question has to be asked: why have only the configuration files been affected?

Or could this problem run deeper?


Additionally could anyone with specifically a Drobo-FS and frimware version 1.2.0 provide their versions of the following files?

/mnt/DroboFS/System/samba/conf/smb.conf
/mnt/DroboFS/System/netatalk/conf/afpd.conf
/mnt/DroboFS/System/netatalk/conf/AppleVolumes.default

With that I could replace the seemingly corrupt files with the correct versions.


And finally, if the Drobo itself is faulty, is the RAID (or BeyondRAID) configuration data stored within the hard drives themselves or the drobo. In other words can I move the existing drives to a new drobo without data loss?

Edit: I can answer my own question here. I discovered this is possible if you move all Drobo disks as a "disk pack" to a new Drobo. The order/position of each drive must to be maintained for this to work.


Edit: Result of cat /proc/mounts

# cat /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / jffs2 rw 0 0
proc /proc proc rw 0 0
devpts /dev/pts devpts rw 0 0
none /sys sysfs rw 0 0
/dev/shm /dev/shm tmpfs rw 0 0
/dev/mtdblock/2 /var jffs2 rw 0 0
/dev/sda1 /mnt/DroboFS ext3 rw,noatime,nodiratime,data=ordered 0 0

Source: (StackOverflow)

What's the typical performance of Windows File Sharing (SMB) on a gigabit ethernet network?

I've recently set up Windows file sharing over a gigabit ethernet network (I'm not using jumbo frames) with a Samba server and a Windows Vista client. I've done a few file copies, but the maximum throughput I'm seeing is 20MB/s (megabytes, not megabits) which is about 15% of the theoretical 125MB/s maximum for the network. The server has a RAID array that can manage about 75MB/s (the bottleneck is the PCI bus), and the client can manage about 40MB/s in a disk-to-disk copy.

I should add that there was no other traffic on the network at the time.

I understand I won't ever get the theoretical maximum, but I didn't think it would be this bad.

What's the typical performance of Windows File Sharing (SMB) on a gigabit ethernet network?

Bonus points: what can I tune (besides using jumbo frames) to make this faster?


Source: (StackOverflow)

Can access Windows share by IP or FQDN address but not by hostname

One of the lab computers at the school I administer is not able to access a any shares under the \\ad\data$ directory. I can access it from any other computer on the network. If I use the IP \\192.168.1.248\data$ I can access the files properly. If I use the FQDN: \\ad.domain.name\data$ it also works. Any other computer at the school is also able to access this share properly.

When I try to access the share with \\ad\data$ I get the message "You do not have permission to access \\ad\data$. Contact your administrator to request access." I am logged in with the domain administrator account.

Any idea on what would cause a single domain computer to not be able to access a share that it should have access to?

The server is running Windows Server 2008 and the computer is running Windows 7 SP1.

UPDATE

Issue is now happening on multiple other computers on the network, staff computers and student computers. I am starting to think there is something seriously wrong with the Active Directory server.


Source: (StackOverflow)

On login, how do I get Windows to mount/connect a mapped network drive automatically?

How do you automount an SMB share in Windows 7? When I first login, the drive appears but is not "mounted". It is a mapped network drive, but iTunes will not find the music located on the server until I click the drive in Windows Explorer and mount the drive. It says in Windows Explorer that the drive is "disconnected".


Source: (StackOverflow)

How can I find the IP of a Windows host from OS X?

Is there an easy way from the OS X (Lion) command line or Finder to determine the IP address of a Windows machine on the same subnet (in a home network)? Assume the machine itself is not easily accessible.

I know of the following ways:

  • Refer to the router(dhcp server)'s web admin page.
  • Use arp -a to get a list of recently accessed IPs and guess from there.

The machine does show up in Finder, so I know it's network computer name (which I'm guessing is a WINS name?), but not what workgroup it is. We are not on a domain.

I'm not entirely sure how OS X "maps" an SMB/WINS name, since doing something like pinging "mywindowsbox" fails, as does pinging "mywindowsbox.local".


Source: (StackOverflow)

Mac OS can't connect to SMB shares after sleep

I used to access my local Windows 2008 file server's SMB shares on my recent (3 weeks old) MacBook Pro without problems. However, for a few days now, it fails to (re-)connect to the server after it woke up from sleep mode.

Finder just shows "connecting..." and hangs indefinitely. The same thing happens when I try it from the command line (mount -t smbfs). This happens via both WiFi and cable, I also tried turning networking off and back on. The only thing that helps is a reboot.

Any hints?

Edit to clarify: It's the Mac that's being put to sleep, not the server. I also found out that if I disconnect the shares before I put it to sleep, it will be able to reconnect after waking up.

Another Edit:

I did some more investigation and sniffed the network traffic. The Mac sends NetBIOS name queries and a status request (NBSTAT) to the server, the server responds, everything seems fine. After that, the Mac should open a SMB connection, but it doesn't do anything. No more packets follow.

I then found out that the real problem lies deeper. It seems it doesn't open a new connection because it thinks the old one, which has of course timed out on the server side, is still active. However, any program that tries to access its mount point or just the /Volumes directory hangs and can't even be killed. umount /Volumes/share - hangs. ls /Volumes - hangs. kill -9 any of these - doesn't help. Also, opening a file open dialog in any application causes it to hang as well!

The only thing that helps is a hard reboot. It seems to me there's something fundamentally wrong in OSX's SMB implementation if a timed out connection can trigger something like this.


Source: (StackOverflow)