Mount a windows NT (NTFS) on linux ( redhat ) how? Samba? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Mount a windows NT (NTFS) on linux ( redhat ) how? Samba?

doomandooman Posts: 2Member
Hi All,

I have been stugling trying to mount a windows ( shared drive ) or any way possible to windows HD via a network on my linux system.

I have tried submount, but I do not know how to do it.

I have heard samba can do it ..how?

Please help!

Ariel

ps: I am using redhat linux (v9) on my pc and (WS) on my server.

Comments

  • arb123arb123 Posts: 696Member
    You can use smbclient to mount remote network drives to your file system. This is usually done in the /mnt directory. You will need to su to root to perform these operations.

    [code]smbmount //host/share /mnt/smb/mntpoint -o username=user[/code]

    e.g.
    [code]smbmount //PC1.mylan.lan/c$ /mnt/smb/PC1 -o username=PC1\Administrator[/code]

    The mount point should be an existing empty directory. Unmount the volume with the command:

    [code]smbumount /mnt/smb/mntpoint[/code]

    ---------------------------------
    [size=1]HOWTO ask questions: http://catb.org/~esr/faqs/smart-questions.html[/size]

  • doomandooman Posts: 2Member
    Thank you, I was (reading a linux book) and found another solution as well!

    For anyone having this problem here is another solution as well!

    mount -t smbfs -o username={windows username},password={windows password} //{name of windows machine}/{name of windows share} {linux path}

    example:
    mount -t smbfs -o username=administrator,password=mypass //mywinpc/cdrive /mnt/cdrive

    thanks for the quick reply!


    ps: where you put this command so it starts when server starts?

    /etc/fstab ?



    : You can use smbclient to mount remote network drives to your file system. This is usually done in the /mnt directory. You will need to su to root to perform these operations.
    :
    : [code]smbmount //host/share /mnt/smb/mntpoint -o username=user[/code]
    :
    : e.g.
    : [code]smbmount //PC1.mylan.lan/c$ /mnt/smb/PC1 -o username=PC1\Administrator[/code]
    :
    : The mount point should be an existing empty directory. Unmount the volume with the command:
    :
    : [code]smbumount /mnt/smb/mntpoint[/code]
    :
    : ---------------------------------
    : [size=1]HOWTO ask questions: http://catb.org/~esr/faqs/smart-questions.html[/size]
    :
    :

  • arb123arb123 Posts: 696Member
    [code]
    //host/share /mnt/smb/mountpoint smbfs auto,owner,credentials=/etc/smbcredentials,fmask=777,dmask=777 0 0
    [/code]
    Where /etc/smbcredentials is a text file containing:
    [code]
    username=ausername
    password=apassword
    [/code]
    The reason for using a separate credentials is so you can put different permissions on the credentials file (everyone can read fstab), but you can specify the info in fstab if you want. Note that automounting a remote smb share at boot can hang your machine if connection problems occur (like the other host not being available).


    I prefer to allow users to mount SMB shares in their home directories as that way users don't need to use common credentials for Windows networking. You can allow users to mount in their home by modifying the permissions on smbfs.
    [code]
    su
    chmod +s /usr/bin/smbmnt
    [/code]
    A users can automatically mount stuff in their login script (~/.bash_profile), for example.

    If there are security side-effects to setting the SUID root bit on smbmnt, I don't know what they are.

    ---------------------------------
    [size=1]HOWTO ask questions: http://catb.org/~esr/faqs/smart-questions.html[/size]

Sign In or Register to comment.