LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   mount windows partition (https://www.linuxquestions.org/questions/linux-networking-3/mount-windows-partition-613513/)

suresheva31 01-14-2008 12:53 PM

mount windows partition
 
Hi there,

i want to mount windows patition using samba.

I believe this is the command:
mount -t smbfs //hostname/c$ /mnt/windows2003

what is the options to enter the username and password in that commnad?

when I execute the above command, it asks for the password, assuming "root" as windows user? I want to put the username and password in the command/

Any idea experts?

Thanks
Kumar

Lenard 01-14-2008 01:50 PM

Try;
mount -t cifs //hostname/c$ /mnt/windows2003 -o user=username,pass=password
mount -t smbfs //hostname/c$ /mnt/windows2003 -o username=Fred,password=something

jschiwal 01-14-2008 02:00 PM

If you have a recent kernel, it would be better using cifs because smbfs is depreciated and unsupported.

You could also create a .credentials file in your home directory that is only readable by you and then mount it with:
sudo mount -t cifs //hostname/sharename /mnt/windows2003 -o cifs,credentials=/home/<username>/.credentials

By the way, only offer as a service on the windows computer what you need to, and never share the C$ drive or any system directory. That is a security risk.


All times are GMT -5. The time now is 08:03 AM.