Jump to content


 


Register a free account to unlock additional features at BleepingComputer.com
Welcome to BleepingComputer, a free community where people like yourself come together to discuss and learn how to use their computers. Using the site is easy and fun. As a guest, you can browse and view the various discussions in the forums, but can not create a new topic or reply to an existing one unless you are logged in. Other benefits of registering an account are subscribing to topics and forums, creating a blog, and having no ads shown anywhere on the site.


Click here to Register a free account now! or read our Welcome Guide to learn how to use this site.

Photo

Samba


  • Please log in to reply
18 replies to this topic

#1 DefaultGateway

DefaultGateway

  • Members
  • 187 posts
  • OFFLINE
  •  
  • Local time:12:41 AM

Posted 05 December 2015 - 06:52 AM

If I do the command "smbclient --list =[FQDN of the Server]", then I get the following error message:

Connection to =[FQDN of Server] failed (Error NT_STATUS_BAD_NETWORK_NAME)

 

I am 100% sure that my DNS settings are correct.

I have installed Samba using "sudo apt-get install samba".

But I haven't configured yet, do I need to configure something before I can access the Samba server from the Client?



BC AdBot (Login to Remove)

 


#2 Naught McNoone

Naught McNoone

  • Members
  • 307 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:The Great White North
  • Local time:06:41 PM

Posted 05 December 2015 - 04:14 PM

. . . installed Samba using "sudo apt-get install samba". . . haven't configured yet . . .

 

DefaultGateway,

 

Yes you do need to configure samba before you can use it.  Simply installing the software will not work for you.

 

1.  You will need to edit the /etc/samba/smb.conf file on your system, to tell samba what and how to share. This requires root privileges.  Most default smb.conf files will work, after you have set up the shares.  They are located near the end of the smb.conf file.

 

2.  You will need to test the system parameters once you have made the changes, and restart the samba server.

 

3.  You will need to set samba privileges on users.  Each user with samba privileges has to have a samba password, in order to access the shares.  Even if you have a wide open share, (ill advised,) there still has to be at least one samba user on the system. 

 

3.  You will need to set the correct permissions and security on the shared files.

 

I suggest you consult the documentation for your specific Linux.  Which distro are you using?

 

Here is the guide for Ubuntu:  https://help.ubuntu.com/community/Samba/SambaServerGuide

 

I also suggest that you use the command line to set up samba.  I have found that gui tools sometimes make mistakes.

 

If you need more help, come back and ask.

 

Cheers!

 

Naught



#3 DeimosChaos

DeimosChaos

  • BC Advisor
  • 1,420 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware
  • Local time:06:41 PM

Posted 05 December 2015 - 09:20 PM

As Naught has said you will need to configure it. The link he has provided is the one I have used myself, just follow what it says and you will have a samba server up and running in no time!


OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +


#4 DefaultGateway

DefaultGateway
  • Topic Starter

  • Members
  • 187 posts
  • OFFLINE
  •  
  • Local time:12:41 AM

Posted 06 December 2015 - 06:29 AM

Thanks for the replies.

But I'm completely new to Samba, and for now I only want that if I do the command "smbclient --list =[FQDN of the Server]", then it works and will not give an error.

 

I have created a user with "sudo smbpasswd -a [Username]".

And then, I have enabled the user with "sudo smbpasswd -e [Username]".

 

I have edited the file "/etc/samba/smb.conf" and put "hosts allow [IP Address] in it, plus some other rules, but that command still doesn't work.

 



#5 Naught McNoone

Naught McNoone

  • Members
  • 307 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:The Great White North
  • Local time:06:41 PM

Posted 06 December 2015 - 10:56 AM

. . . completely new to Samba . . . only want that . . . the command "smbclient --list =[FQDN of the Server]" . . . but that command still doesn't work

 

OK.  You seem to have been going about it the wrong way.

 

First of all, smbclient is an FTP tool for samba.  It is designed to talk to samba servers, and act like a command line FTP client on a remote server.

 

So, right off the bat, if you are trying to use it on the same machine you are using as the server, then you will run into problems.

 

Samba is a network sharing tool that allows you to share files and printers in the network, very much like Windows Networking.  In fact the two work together.

 

When you set up your samba shares, you are allowing another computer to access those folders using it's own native networking.

 

"Browse Network" in Windows should show you a list of browsable samba shares in your local network.  If the shares are listed as non-browsable in samba, you have to type the network location in manually, in the Windows address bar.

 

If you are sharing between two Linux machines, you would browse through your file manager (most of them have that built in ability,) or you could permanently map a network drive using the mount command.

 

Either one, clicking on the share should prompt you for a username and password.

 

So, what do you want to do?  FTP between two different computers, or set up a network file server?

 

It would help to know how many computers you have in your network, and which operating systems they are using.

 

Cheers!

 

Naught


Edited by Naught McNoone, 06 December 2015 - 10:58 AM.


#6 DefaultGateway

DefaultGateway
  • Topic Starter

  • Members
  • 187 posts
  • OFFLINE
  •  
  • Local time:12:41 AM

Posted 06 December 2015 - 11:53 AM

Thank you for replying.

That command "smbclient --list =[FQDN of the Server]" I am doing on the Client. So I am not doing that at the same machine =>Server.

The Client cannot make a connection with the Samba installed on Server.

 

I'm doing this with VMware Workstation for educational purposes, and all my DNS settings and network cards are correctly configured.


Edited by DefaultGateway, 06 December 2015 - 11:55 AM.


#7 Naught McNoone

Naught McNoone

  • Members
  • 307 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:The Great White North
  • Local time:06:41 PM

Posted 06 December 2015 - 03:13 PM

. . . "smbclient --list =[FQDN of the Server]" . . . cannot make a connection with . . .  Server.

 

Ok . . .

 

The domain name of the server will not help you.

 

You need to specify the NetBIOS/NetBEUI name, or use the -I switch to specify the ip of the server.

 

Is the server in your local network?  If not, then you will not connect.  Samba is normally not routable.

 

It will work in theory, but requires a lot more configuration.  Also, it is unsafe.  Once you start sending samba packets through the internet, you are wide open to all sorts of security issues.

 

I suggest that you might want to look at other means to connect your two computers.

 

Cheers!

 

Naught



#8 DefaultGateway

DefaultGateway
  • Topic Starter

  • Members
  • 187 posts
  • OFFLINE
  •  
  • Local time:12:41 AM

Posted 07 December 2015 - 04:26 AM

I don't know exactly what the cause was, but that command is working right now.

I think it was that the Client couldn't reach the server, because when I ping from Server to Client, it didn't go directly.

But then the ping was succesfull, and now that command is working.

 

My firewall on the host is set up to block SMB, but I'm not sure that the Firewall was the cause, because when I turn off the Firewall, that command was still not working.

And my firewall is now turned back on, and that command still works.

 

Thanks again for replying and cheers!



#9 DefaultGateway

DefaultGateway
  • Topic Starter

  • Members
  • 187 posts
  • OFFLINE
  •  
  • Local time:12:41 AM

Posted 07 December 2015 - 04:46 AM

I found out that I must omit the "=".

So it's "smbclient --list [FQDN of the Server]".



#10 DefaultGateway

DefaultGateway
  • Topic Starter

  • Members
  • 187 posts
  • OFFLINE
  •  
  • Local time:12:41 AM

Posted 08 December 2015 - 05:30 AM

If you are sharing between two Linux machines, you would browse through your file manager (most of them have that built in ability,) or you could permanently map a network drive using the mount command.

 

On my server, I created a folder. And I want that Client can access it, how do I mount on the Client the folder on the Server?

Which rule must I add in "/etc/fstab"?



#11 DeimosChaos

DeimosChaos

  • BC Advisor
  • 1,420 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware
  • Local time:06:41 PM

Posted 08 December 2015 - 06:27 AM

So to access that folder you would just go to your folder browser window. You should then see a "connect to server" or something similar on the left hand side. You would then input:

smb://serveraddress

That should connect you to the server. You do not need to mount it via fstab.


OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +


#12 DefaultGateway

DefaultGateway
  • Topic Starter

  • Members
  • 187 posts
  • OFFLINE
  •  
  • Local time:12:41 AM

Posted 08 December 2015 - 06:36 AM

Thank you for your reply.

But I don't see "Connect to server" or something like that.

I'm using Ubuntu 12.04.5 LTS.

 

There is a shared folder on my Server.

On my Server, I can access that folder itself, and I see that it's shared.

But on my Client, I don't know how to get to that folder.



#13 DeimosChaos

DeimosChaos

  • BC Advisor
  • 1,420 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware
  • Local time:06:41 PM

Posted 08 December 2015 - 06:59 AM

It might be something like "browse". But typically it will be on the bottom left hand side of your folder browser window. It will allow you to put in the server IP address to connect to it.

Ahhh, looking on the web it should be "Browse Network": look right below the red box in the picture below. You should see the "Browse Network" on your folder browser as well.

 

nautilus-bookmarks.jpg


OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +


#14 DefaultGateway

DefaultGateway
  • Topic Starter

  • Members
  • 187 posts
  • OFFLINE
  •  
  • Local time:12:41 AM

Posted 08 December 2015 - 07:12 AM

On the Client, if I click on "Browse Network", then I only see "Windows Network" folder. I don't see my Server folder.

But on the Server, if I click on "Browse Network", I see "Windows Network" folder along with my Server folder.

 

On Client, I cannot access the "Windows Network" folder.

But on Server, I can access it.

 

On the Client, if I try to access the "Windows Network Folder", it says Unable to mount location.

Failed to retrieve share list from server.



#15 DeimosChaos

DeimosChaos

  • BC Advisor
  • 1,420 posts
  • OFFLINE
  •  
  • Gender:Male
  • Location:United States, Delaware
  • Local time:06:41 PM

Posted 08 December 2015 - 07:23 AM

Try running:

nautilus smb://serveraddress


OS - Ubuntu 14.04/16.04 & Windows 10
Custom Desktop PC / Lenovo Y580 / Sager NP8258 / Dell XPS 13 (9350)
_____________________________________________________
Bachelor of Science in Computing Security from Drexel University
Security +





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users