2

I successfully mounted my external hard drive (ntfs) to /mnt/seagate. I'm using debian and the server is connected over LAN to my PC. So how can I mount my hard drive in my windows explorer without using ftp?

$ nano /etc/fstab:

[..]
# Seagate
/dev/sdb1 /mnt/seagate ntfs defaults 0 2

# Medion
/dev/sdc1 /mnt/medion ntfs defaults 0 2
2
  • at the same time or one at a time?
    – Skaperen
    Commented Apr 25, 2015 at 9:54
  • Is that important? I would say once. My seagate will be auto mounted on boot. I'm not sure if that was the needed answer.
    – Tomblarom
    Commented Apr 25, 2015 at 9:56

1 Answer 1

6

1) Download and install Samba:

apt-get install samba samba-common

2) Backup samba.conf:

cp /etc/samba/smb.conf /etc/samba/smb.conf.bak

3) Edit samba.conf:

nano /etc/samba/smb.conf

Replace all with and edit it to your wishes:

[global]
        workgroup = arbeitsgruppe
        server string = %h server (Samba %v)
        log file = /var/log/samba/log.%m
        max log size = 1000
        encrypt passwords = true
        invalid users = root
        socket options = TCP_NODELAY
        security = user
        unix extensions = yes

[homes]
        comment = Home Directories
        browseable = no
        valid users = %S
        writable = yes
        create mode = 0600
        directory mode = 0700

4) Create a samba user:

adduser --disabled-login --shell /bin/false --home <home path - ex. /mnt/seagate> <username>

Add user to samba:

smbpasswd -a <username>

5) Restart samba:

service samba restart or /etc/init.d/samba restart

6) Add samba to windows: Pictured description will be found on this site (german).

Briefly: Add \\<local or external ip>\<username> to your windows file explorer.

IMPORTANT: You can't mount two same devices with different shares in windows file explorer. For example:

\\192.168.1.35\<username1 or share1> and \\192.168.1.35\<username2 or share2>

If you add share2 the windows explorer thinks that there's already a connection (via share1), but you think the username or password on the samba-server is wrong. No it's a windows-client problem!

To solve it, you need to use netbios alias. For example:

[global]
        [..]
        netbios aliases = alias1 alias2 alias3
        [..]

So use this:

\\alias1\<username1 or share1> and \\alias\<username2 or share2>

instead of this:

\\192.168.1.35\<username1 or share1> and \\192.168.1.35\<username2 or share2>

Commands:

$ testparm                Test samba configuration
$ pdbedit -L             Show all vaild samba users
$ pdbedit -x -u <user>   Remove user
$ smbpasswd -a <user>       Add user to vaild samba users / Give password
$ smbpasswd -d <user>       Remove user from vaild samba users
$ service samba restart  Restart samba
1
  • @Mat I already updated my answer ;) You should have a look!
    – Tomblarom
    Commented Aug 15, 2015 at 19:05

You must log in to answer this question.

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