0

Edit: Ok. I was able to mount a single drive. What can I do to "mount" the entire server?

This is my situation:

I have a couple of Windows 7 machines, that share folders and entire drives.

I am using Kali Linux. How can I get to these folders/drives?

I tried smb:// but command not found. I have samba installed.

I npammed the ip address of the computer sharing the files and tried to mount it like this:

enter code hereroot@kali:/media/iron# mount //192.168.1.6 /media/iron/production-2
Password for root@//192.168.1.6:  *******
mount error(22): Invalid argument
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

The password was correct. Also I don't remember the exact path to the shares. How can I mount the entire drive to my own computer?

Also any idea why the Windows Network tab in GUI doesn't show anything?

5
  • Perhaps try specifying the name of the shared folder in your mount command? mount //192.168.1.6/sharefolder /media/iron/production-2
    – 0xhughes
    Aug 24, 2017 at 4:30
  • Yea that works. But why can't I just mount the entire server/ browse through it to see the paths? Aug 25, 2017 at 13:17
  • I'm not sure on your specific case, but generally when you create a share, you are sharing an entire folder. So in order to see the entire contents, you'd have to share the root of the drive, IE, right click on the C:\ drive and share it, then try to mount it. In mind be aware that this presents a bit of a security concern as in theory I could collect sensitive files like your SAM file, browser files, etc. Given your risk/purpose that may not be a concern to you, just some food for thought.
    – 0xhughes
    Aug 30, 2017 at 14:49
  • Also, if you DID share your entire, say "C:" drive, you may need to refer to that specifically in your mount target. For example, "mount //192.168.1.6/c$..." or, "mount //192.168.1.6/c...", not sure if *nix uses same/similar pathing to the root of c drive over the network as Windows does.
    – 0xhughes
    Aug 30, 2017 at 14:50
  • The entire computer has a bunch of drives shared. On Windows I just go to network and I see all of them. Can I somehow see all the shared resources on the network? Aug 30, 2017 at 17:24

1 Answer 1

2

You use Samba to run Linux as a CIFS server and optionally as a domain controller. It serves shares - it doesn't mount them.

To mount drives you either need the smbfs kernel module (which you appear to have and are trying to use) or a suitable FUSE module (such as smbnetfs) - both will make the shares available to any program. The KDE and Gnome and Gnome desktop environments have filesystem wrappers that allow compliant software to access the shares.

I npammed the ip address of the computer sharing the files and tried to mount it like this

Did you read the man page for mount.cifs?

Did you notice you are being asked for the password for root - not the any of the users associated with the share? When mount doesn't know what username to use when connecting to a remote filesystem it falls back to the username of the process which invoked it. Try

mount //192.168.1.6/sharename /media/iron/production-2 -o username=alex

(change "alex" to your username on the MSWindows box, and "sharename" to the name you chose when you shared the directory).

To find out what shares are exposed on your mswindows box, try

 smbclient -L hostname -I 192.168.1.6

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .