Thursday, April 26, 2012

Connecting to a Windows Shared folder from Linux

Even though I have been using Windows and Linux separately for quite some time now, I only very recently had the need to access a shared folder on a Windows machine from a Linux box using a command line. I came across loads of information and tools which are available for accessing shares among Linux and Windows.

And even though there might have been some helpful page which has it all listed out - I had to go through a little bit of trouble finding what I had to know and do to make it work, so I am listing them down for future reference and/or helping out if someone finds themselves in a similar position.

Since I had to access the shared folder using command line (being used in a tool which I am using telnet to servers and running command from the telnet prompt to access certain files from Windows/Linux machines) most of the easiest ways e.g. using Filezilla, FTP amongst others were out, so to compile the information I found helpful:

1. I have to mount shared windows folders on the linux machine to be able to access those shared files

2. To be able to mount folders, the Linux machine needs Samba running (there are many helpful sites which help in setting up Samba) and to quickly check if it is running or not, type : ps -ef | grep smb (there is actually no space between 'ef', '|' and 'grep' - only for formatting purposes).

If results with smbd -D show up, it means Samba is already installed and working (which was in my case)

another way to check it is going through the UI looking for "Connect to Server.." and actually trying to connect to the share - but only for confirmation since this method was out of bounds for me.

3. Create a folder where the shared folder will be mapped to in /mnt - at the end of the process all the shared folder contents show up in this folder.

4. Many helpful forums suggested using something like:

sudo mount -t nsf -o username=xxx,password=xxx //<IP/hostname>/<shared folder> /mnt/<mapped folder>

or without the '-t nsf' which is for the network shared file type, but unfortunately they didn't work, but

sudo mount -t cifs //<IP address/hostname>/<Shared folder name> /mnt/<created folder for mapping> -o username=xxx,password=xxx

worked for me (the share was on a Windows Server 2008 R2 machine)

Incase Windows to Windows shared map has to be created the best way I found to be was to use:

net use <free drive Letter>: \\<IP/hostname>\<shared folder> /user:<username> <password>

Clean up also should be performed, using umount and /delete with net use for the Linux and Windows respectively created mapped shared locations.

32 comments:

password shared folder said...

Very helpful information on this post, thank you for sharing.

Anonymous said...

Hello. And Bye. Thank you very much.

Anonymous said...

Hello. And Bye. Thank you very much.

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

Hi there to every , since I am really keen of reading this blog's post to be updated on a regular basis. It carries fastidious material.

Also visit my website; プラダ 財布

Anonymous said...

I was wondering if you ever considered changing the page layout of
your website? Its very well written; I love what youve got to say.
But maybe you could a little more in the way of content so people could connect with it better.
Youve got an awful lot of text for only having one or 2 images.
Maybe you could space it out better?

Also visit my site: ロレックスレプリカ

Anonymous said...

I like looking through an article that can make men and women think.
Also, thank you for allowing for me to comment!


Also visit my website ... スーパーコピー

Anonymous said...

It's amazing for me to have a web site, which is beneficial for my knowledge. thanks admin

Also visit my blog - cheap mac makeup

Anonymous said...

Hi there this is kinda of off topic but I was wondering if
blogs use WYSIWYG editors or if you have to manually code with HTML.

I'm starting a blog soon but have no coding knowledge so I wanted to get advice from someone with experience. Any help would be greatly appreciated!

Also visit my weblog www.madakasira.com

Anonymous said...

I like the valuable info you provide in your articles.
I will bookmark your weblog and check again here frequently.

I'm quite sure I will learn many new stuff right here! Good luck for the next!

Here is my blog; グッチ バッグ

Anonymous said...

First of all I would like to say excellent blog! I had a
quick question which I'd like to ask if you do not mind. I was curious to find out how you center yourself and clear your mind prior to writing. I've had
a tough time clearing my thoughts in getting my thoughts out.

I do enjoy writing however it just seems like the first 10 to 15 minutes are usually
wasted just trying to figure out how to begin. Any recommendations or tips?

Many thanks!

My website; fake ray ban sunglasses

Anonymous said...

I like the helpful info you provide in your articles.
I'll bookmark your blog and check again here frequently. I am quite certain I'll learn many new stuff right here!

Best of luck for the next!

Visit my site :: Nike Free Run

Anonymous said...

This article presents clear idea for the new visitors of blogging, that in fact how to
do running a blog.

Also visit my site: polo ralph lauren outlet

Anonymous said...

Hi to all, how is everything, I think every one is getting more from this site, and your
views are pleasant designed for new visitors.


my weblog :: ミュウミュウ

Anonymous said...

Howdy! This is kind of off topic but I need some guidance from an established
blog. Is it very difficult to set up your own blog? I'm not very techincal but I can figure things out pretty fast. I'm thinking
about setting up my own but I'm not sure where to start. Do you have any points or suggestions? With thanks

My homepage ... chloe 財布

Anonymous said...

Valuable info. Lucky me I discovered your website by chance, and I'm surprised why this twist of fate didn't took place
earlier! I bookmarked it.

Feel free to visit my web blog: COACH 財布

Anonymous said...

Thanks for sharing your thoughts on miu miu bag.

Regards

Here is my web blog :: ミュウミュウ

Anonymous said...

Hello there, I found your web site by means of Google whilst searching for a similar subject, your site came up, it looks good.

I've bookmarked it in my google bookmarks.
Hello there, just was aware of your blog via Google, and located that it is really informative. I'm going to watch out for brussels.
I will appreciate in the event you continue this in future.

Many people will probably be benefited from your
writing. Cheers!

Look at my web site - クリスチャンルブタン

Anonymous said...

This is very interesting, You're a very skilled blogger. I have joined your feed and look forward to seeking more of your great post. Also, I've shared your web site in
my social networks!

Here is my homepage http://www.punkrockracing.com/member/235145

Anonymous said...

Hi, I check your blog on a regular basis. Your writing style is awesome, keep doing what
you're doing!

Feel free to visit my blog: expert appliance repair Tampa Florida area

Anonymous said...

I think this is among the most important info for me. And i'm glad reading your article. But wanna remark on some general things, The web site style is perfect, the articles is really excellent : D. Good job, cheers

Feel free to surf to my web site トリーバーチ

Anonymous said...

I leave a leave a response each time I especially
enjoy a post on a site or I have something
to add to the conversation. Usually it's a result of the fire displayed in the article I browsed. And on this article "Connecting to a Windows Shared folder from Linux". I was actually excited enough to drop a thought ;) I actually do have a few questions for you if you do not mind. Is it simply me or does it look like like some of the comments come across like they are left by brain dead visitors? :-P And, if you are posting on additional online social sites, I would like to follow you. Could you make a list every one of your communal sites like your linkedin profile, Facebook page or twitter feed?

My weblog ... chloe 財布

Anonymous said...

Just want to say your article is as surprising. The clearness in
your post is just cool and that i can think you're an expert on this subject. Fine along with your permission let me to grab your RSS feed to keep up to date with coming near near post. Thank you one million and please carry on the enjoyable work.

Here is my webpage - lusciouswatchs.mylivepage.com

Anonymous said...

This information is worth everyone's attention. How can I find out more?

Feel free to surf to my weblog: www.joraweb.com

Anonymous said...

It's a shame you don't have a donate button!

I'd most certainly donate to this excellent blog! I suppose for now i'll settle for book-marking and adding your RSS feed to my Google account.
I look forward to new updates and will talk about this
website with my Facebook group. Chat soon!

Also visit my page - Ralph Lauren Outlet

Anonymous said...

I've been browsing online greater than 3 hours these days, but I never discovered any attention-grabbing article like yours. It's pretty worth enough for me.
In my opinion, if all webmasters and bloggers made good content as you probably did, the internet might be much more useful than ever before.


Here is my page ... Christian Louboutin Pumps

Anonymous said...

Saved as a favorite, I love your website!

Also visit my web site クロエ店舗

Anonymous said...

We're a bunch of volunteers and opening a new scheme in our community. Your site offered us with valuable info to work on. You have performed an impressive task and our entire group will be thankful to you.

Feel free to surf to my web site www.new-oldcabin.blogspot.fr

Anonymous said...

Do you mind if I quote a few of your posts as long as I provide credit and sources back to your blog?

My blog is in the very same area of interest as yours and
my users would definitely benefit from some of the information you provide here.
Please let me know if this okay with you. Thanks a lot!


Here is my site supra vaiders

Anonymous said...
This comment has been removed by a blog administrator.
Anonymous said...

Wow that was odd. I just wrote an extremely long
comment but after I clicked submit my comment didn't appear. Grrrr... well I'm not
writing all that over again. Anyway, just wanted to say superb blog!



my blog post - グッチ 財布 - -