LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-01-2018, 01:20 AM   #1
banderas20
Member
 
Registered: Aug 2018
Posts: 138

Rep: Reputation: Disabled
Question SAMBA problems with Windows


Hello guys,

I have just installed SAMBA in a Debian box. The only thing I have done has been edit /etc/samba/smb.conf and changed the workgroup so that it matched witch my Windows box.

Then I restarted the smbd service and tried to browse "Other locations" with the gnome File Explorer. It doesn't even show the windows machine.

¿What's wrong?

Thanks!
 
Old 08-01-2018, 07:06 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Welcome to LinuxQuestions.

What version is running on the Windows machine?

Have you created shares on the Windows computer that is not a homegroup?

Do you have other linux computers that can see the shares?
 
Old 08-01-2018, 07:54 PM   #3
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Michaelk made a nice catch about Homegroups. They are visible only to Windows machines. I had forgotten about Homegroups.

Try pointing smbclient at the Wihdows machine; it will tell what Samba is seeing. Here's the instructions: https://www.tldp.org/HOWTO/SMB-HOWTO-8.html

Last edited by frankbell; 08-01-2018 at 08:03 PM.
 
Old 08-01-2018, 09:00 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
FYI smbclient is not installed by default anymore and is part of the samba-common package. apt-get will resolve all dependencies and automatically install everything.

apt-get install smbclient (as root via the su command)
 
Old 08-01-2018, 09:11 PM   #5
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,324
Blog Entries: 28

Rep: Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142Reputation: 6142
Quote:
smbclient is not installed by default anymore
Well, that's less than desirable. Thanks for updating me.

I remember when I set up my first shared printer from a Windows XP computer to a Linux client. It was smbclient that enabled me to make it work.
 
Old 08-02-2018, 09:14 AM   #6
banderas20
Member
 
Registered: Aug 2018
Posts: 138

Original Poster
Rep: Reputation: Disabled
Smile

Hello and thanks for replying.

I'm running windows 7 ultimate x64, and I have created the share.
I also realized about the "smbclient" does not come by default. What a pain in the ass until I found out...

If I run

Code:
smbclient -L <winhost> -U <username>
it prompts for the Windows username and it displays the shares!!

How can I connect to a share (mount it ) permanently?

Thanks!
 
Old 08-02-2018, 11:05 AM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,702

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
In the file browser you can create a bookmark to the share. From the pull down menu File -> Connect to Server. Select "Windows Shares" for type and then enter in all the information. This is a virtual file system that is available within the desktop although it should be also mounted in the traditional manner but the exact location tends to change with gnome versions. This is probably the easiest method.

You can mount it from /etc/fstab. There are several options and if the Windows Box is not always on I might suggest using autofs or systemds automount. The share will only mount when you try to access the Windows box and the system will not try to mount if the the Windows computer is not running. The Windows drive will be accessible like an external drive.
 
Old 08-02-2018, 12:46 PM   #8
banderas20
Member
 
Registered: Aug 2018
Posts: 138

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
In the file browser you can create a bookmark to the share. From the pull down menu File -> Connect to Server. Select "Windows Shares" for type and then enter in all the information. This is a virtual file system that is available within the desktop although it should be also mounted in the traditional manner but the exact location tends to change with gnome versions. This is probably the easiest method.

You can mount it from /etc/fstab. There are several options and if the Windows Box is not always on I might suggest using autofs or systemds automount. The share will only mount when you try to access the Windows box and the system will not try to mount if the the Windows computer is not running. The Windows drive will be accessible like an external drive.
Thanks. Can I do it via command line?

Regards!
 
Old 08-03-2018, 08:10 AM   #9
bgstack15
Member
 
Registered: Jul 2017
Distribution: korora
Posts: 90

Rep: Reputation: Disabled
You will want to run something like the following:
Code:
mount -t cifs -o credentials=/root/.cifscredential,uid=1002,gid=1002 //winhost/Public /mnt/WinPublic/
Where uid and gid are the uid and gid (or username and group name) of the Linux user/group you want to be the "owner" of the files. The credentials variable is a file whose contents are:
Code:
username=winuser
password=plaintextpw
With an additional definition for domain, if required.

If you are fine with it, you could omit the password, and running the mount command will prompt you and mask the entered value with asterisks.

For an entry in /etc/fstab, it would look like:
Code:
//winhost/Public /mnt/WinPublic cifs credentials=/root/.cifscredentials,domain=example.com,noperm,uid=banderas20,gid=banderas20 0 0
I cannot test this right now, but I assume you could also add to the options field the value "noauto" so it does not try to mount on boot. If you're working on a system that is not always on the same network as the cifs server, try the "noauto" flag. But, regardless of the "noauto," you could then just run mount /mnt/WinPublic and it'll prompt for pw if not defined, and then mount it for you!

Last edited by bgstack15; 08-03-2018 at 08:10 AM. Reason: formatting
 
Old 08-04-2018, 05:51 AM   #10
banderas20
Member
 
Registered: Aug 2018
Posts: 138

Original Poster
Rep: Reputation: Disabled
Hello.

I have been able to do it both ways. In the way Linux -> Windows I tried with smbmount, as several webs explain. However, I don't have that command neither can download it via the repositories.

The I tried with mount -t smbfs, but it didn't recognize the filetype.

If I issued apt-get install smbfs, the result was:
Code:
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Package smbfs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
  cifs-utils
I wanted to do it via samba packages, but it gave me no choice. Once I installed cifs-utils, the proper command worked like this:
Code:
mount -t cifs //windows_host/folder /mount/point/ -o username=uname,uid=uname,gid=uname
Thanks for your help! And I hope this solution helps other people with similar issues.
 
  


Reply



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
Samba writing problems (windows 7) Vodkaholic1983 Linux - Software 3 06-11-2012 05:39 PM
Problems with Samba 3.2 - Windows Vista and 98 tiuz Linux - Networking 3 09-21-2009 12:25 PM
Samba 3 and Windows XP PRoblems Lee_Ball Linux - Networking 0 07-05-2005 03:58 PM
Windows XP and Samba problems cadkins Linux - Networking 1 04-06-2005 06:06 PM
Samba Windows administrtor problems tonyr321 Linux - Networking 2 03-31-2005 06:23 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:14 AM.

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
Open Source Consulting | Domain Registration