LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-29-2013, 09:25 PM   #1
pph765
LQ Newbie
 
Registered: Dec 2006
Posts: 2

Rep: Reputation: 0
Lightbulb 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?
 
Old 03-29-2013, 09:43 PM   #2
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,333
Blog Entries: 12

Rep: Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729
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
NarwhalLX frankbell # mount /dev/sda2 /mnt/sda2
NarwhalLX frankbell # ls /mnt/sda2
aaw7boot.log            Intel                $Recycle.Bin
$AVG                    mfg                  RHDSetup.log
Books                   msdia80.dll          RRbackups
Boot                    pagefile.sys         swshare
bootmgr                 PerfLogs             SWTOOLS
BOOTSECT.BAK            PMAIL                System Volume Information
Config.Msi              ProgramData          Users
Documents and Settings  Program Files        Windows
hiberfil.sys            Program Files (x86)
You can learn more about fstab (file system table) here.

Last edited by frankbell; 03-29-2013 at 09:46 PM.
 
Old 03-29-2013, 10:01 PM   #3
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
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
/home/shared is obviously the location where the shared drive is being mounted on the Linux boxes (which must be created before trying to mount there), "source" is a generic group that all developers on the network are members of, and /etc/sambapasswords is a simple ascii file containing the authentication information for the mount, of the format:
Code:
username = <user>
password = <pass>
Of course replacing <user> and <pass> with the username and password you want to use for authentication.

Last edited by suicidaleggroll; 03-29-2013 at 10:05 PM.
 
1 members found this post helpful.
Old 03-29-2013, 10:50 PM   #4
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Debian, Mint, OpenBSD
Posts: 11,333
Blog Entries: 12

Rep: Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729Reputation: 2729
Oops. Thanks for catching my mistake.
 
Old 03-30-2013, 01:30 AM   #5
pph765
LQ Newbie
 
Registered: Dec 2006
Posts: 2

Original Poster
Rep: Reputation: 0
Angry 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.
 
Old 03-30-2013, 02:31 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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.
 
Old 03-30-2013, 03:35 PM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,258

Rep: Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947Reputation: 1947
Quote:
Originally Posted by pph765 View Post
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 Windows machine should have a static IP.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Share Linux Dir and access through windows rajes4india General 5 04-12-2012 07:02 AM
windows share to access from linux pc salimshahzad Linux - Server 2 12-12-2009 08:49 AM
How access the command line Terminal in Ubuntu linux? bmnb123 Linux - Newbie 2 04-10-2008 03:12 PM
Access linux SAMBA share from windows pengu Linux - Software 6 02-17-2007 12:55 PM
cannot access my Linux share from Windows va7hg Linux - Networking 6 12-13-2005 09:00 AM


All times are GMT -5. The time now is 01:53 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration