How to access Windows's share in Linux terminal command?
Hi experts,
How to access Windows's share in Linux terminal command? I am using LinuxMint 14, Mate. I can access MS Windows shares through GUI, but I can't access Win share in terminal. People told me I need mount the shares.I tried many ways but all end up failed to access the windows share. Can anybody help me? |
I just did it in this fashion:
I su'ed to root, then determined the identity of the Windows driver with fdisk -l (sda1 and sda2). Then, still as root, I created a mountpoint in /mnt, and mounted the drive as follows (unless otherwise specified in fstab, only root can mount a drive; typically, removable devices can usually be mounted by the logged-in user who connects them): Code:
NarwhalLX frankbell # mkdir /mnt/sda2 |
frankbell - That process is for mounting a local drive of any format (ext, windows, etc). That's not what the OP is asking for. He's asking how to mount a shared Windows drive over the network.
OP - You should use cifs to mount a networked Windows share, see below. I maintain a Windows/Linux shared network that uses a setup like this, so my config might be helpful to you. I have a WinXP machine located at 192.168.1.118 sharing a folder called "shared" on the network. The Linux machines (all of them, from CentOS to Fedora to OpenSUSE) have the following in /etc/fstab: Code:
//192.168.1.118/shared /home/shared cifs auto,_netdev,gid=source,file_mode=0664,dir_mode=0775,iocharset=iso8859-5,credentials=/etc/sambapasswords 0 0 Code:
username = <user> |
Oops. Thanks for catching my mistake.
|
Thanks. But I can not locate "/etc/sambapasswords"
Thank you very much. It sounds OK. But I can not locate the file "/etc/sambapasswords" (I did "sudo smbpasswd -a <myself>")
I'm running LinuxMint 14 & LMDE 201303 Desktop (Debian Edition, Mint, KDE) Another Question: Can I replace the IP address (192.168.1.xx) with the windows system name <\\system12> ? Cause IP address assigned by the router, not necessary constant. |
The name and location of the credentials file is arbitrary. It should be accessible only by the user who should know the username & password. I use $HOME/.credentials. You create this file yourself. The reason being is that credentials in the fstab file would be readable by everyone. So the fstab file only contains the location of the file containing the creds. It's up to you to use permissions that maintain the secrecy of the credentials.
|
Quote:
|
All times are GMT -5. The time now is 09:36 AM. |