Jump to content

Setting Up Network


xboxboy
 Share

Recommended Posts

Hi guys.

 

I was hoping this would be simple, but I am getting lost so easily :(

 

What I have is I have built a new PC running Mageia to be my server/main business desktop. On this machine I will do most of my creative stuff and store my data.

 

I have a windows 7 laptop which is neccesary for some programs which I need to use that are proprietary.

 

What I had planned to do was set up a samba share so that my windows 7 laptop can access the linux server with all the data on it, and treat it as a local drive/file.

 

Am I going the right way about this? If so, can I please get some advise on how to make this happen?

 

Or if I'm going about it wrong, a new plan of attack?

 

Regards.

XBOXBOY

Link to comment
Share on other sites

That's about your only way, with samba configured and running on the Linux Machine. I do similar to this. I have my user "ian", which has the home directory /home/ian. My samba is configured to allow the users to connect, of course to \\x.x.x.x\ian from the Windows machine (where x.x.x.x is the IP of your Linux machine). I then give my Linux username "ian" and the associated password so that I can connect.

 

All the work you do then on Linux will be under your home directory, so you won't have to store it anywhere else. If of course you want others to access it, then you would have to store it in another place and allow either public access (eg: without authentication - not secure), or configure a specific share that everyone will have access to once you add the users. They can then authenticate with their own username/password to access the files.

 

I have the first method I suggested using my home directory, because I'm the only user, and so makes more sense and keeps things simple.

Link to comment
Share on other sites

Hi Ian,

 

Ok. So we agree that Samba is the way forward.

Now, I've looked at plenty of info, but I continue to get so lost in the detail :(

 

Is the basic process:

1: Build samba server on linux box.

2: Get windows to connect to samba server.

 

Sounds simple, but I'm stuck on all the little details.

 

Details such as, the network name. How do I tell what that is? Or do I need to create that?

 

My two pcs are connected through a router BTW.

 

Any help most appreciated.

Link to comment
Share on other sites

Providing it still exists in Mageia, install the drakwizard package, and you can then use MCC to click and configure Samba easily enough. However, the default packages should install and configure samba enough for you to be able to access your home directory.

 

In terms of network name, not entirely sure what you're on about - if you mean workgroup, then you configure whatever you want, best bet is to make sure that the workgroup on the Windows machine and the Linux machine are the same. The workgroup will show when you browse under Network Neighbourhood. The share is just as I put, with home directories there is nothing to configure, later you just connect to \\x.x.x.x\username (in my example I put ian). If you are just mapping drives, or connecting with Start, Run and then typing like what I've put here, then the workgroup you won't need to worry about.

Link to comment
Share on other sites

Hi Ian,

 

I followed your advice and installed drakwizard (surprised it's not installed by default).

 

I also followed Older Mandriva Samba Install somewhat.

 

I'm now at the point where I can see a 'homes' folder on my windows 7 machine, but I am unable to connect to it. My printer shows up, which is a good sign I hope.

 

Are we at the stage where I should be using smbclient to test the server setup?

 

I've been trying for a few hours tonight, but I just keep going in circles.

Link to comment
Share on other sites

You should normally just click Start and then Run (or can use the Windows key + R) and it will bring up the run dialog. In here, put:

 

\\x.x.x.x\username

 

and it will then ask you to provide username and password details. Replace x.x.x.x with the IP of your Linux machine, and username with your username on the Linux box. Homes by default are not browseable, and it's why you don't see them.

Link to comment
Share on other sites

Ah, ok, I did that Ian. It did not ask for a username or password, but I could see all the directories in my home folder. When I tried to open a file from windows, I got a warning that the file is locked for editing by "username".

 

So we are making progress, but I have got a permission issue somewhere.

Link to comment
Share on other sites

Check your /etc/samba/smb.conf:

 

[homes]
  comment = Home Directories
  browseable = no

  read only = no

  create mask = 0700

  directory mask = 0700

  valid users = %S
  guest ok = no

 

this is part of my smb.conf for the home directories. Also, after you've done this, you'll need to create the samba user for "username", so in my example, I use my name "ian".

 

smbpasswd -a ian

 

provide password for connecting from windows. ian is my Linux home directory user. I generally set the password the same as my Linux user password.

Link to comment
Share on other sites

Thanks Ian, that worked! I know get asked for password, and have viewing access.

Unfortunately I do not have write access.

Heres part of my /etc/samba/smb.conf:

[homes]
   path = /home/"username"
   comment = Home Directories
   browseable = yes
   public = yes
   writable = yes

 

Mine is different in that it doesn't list"

create mask = 0700

  directory mask = 0700

  valid users = %S
  guest ok = no

Link to comment
Share on other sites

I would add those options, mainly because then it secures it a bit more, and could be part of the reason why you cannot save anything. If you have the writable option and you logged in, then it should work, but perhaps the valid user option is blocking it.

 

Did you add a user with smbpasswd?

Link to comment
Share on other sites

Hi Ian.

 

No, I added the users using DrakSamba, the GUI.

 

I think I found the drama! I had created another user on the linux box, and was logging in under that user, hence the read only access to the required user /home.

 

It appears to be working ie. read/write access. Now, I just have to work on the windows side to get it all sorted back there :) Hopefully it should do I as I tell it to.

 

I won't mark as solved until I'm completely sorted :)

 

Thank you so much for the help Ian. Now, I have an understanding of Samba. It is simple, if you know where to start and where to aim.

Link to comment
Share on other sites

  • 2 weeks later...

I broke it :(

 

I didn't realise, but I had it set up funny before. Somehow it was working through my wireless router.

 

What I want is for the linux server box and the win 7 machine to be connected through an ethernet switch/hub.

 

Now I simply can't get any sommunication at all.

 

The switch is also connected to my 3g router, so thats how the internet is accessed.

The routers ip is 168.192.1.1, pretty standard.

 

Should the linux samba box have a static ip? When I set a static IP, i loose internet connectivity and have network problems. When I put it back to auto I at least have internet access.

 

Any advice?

 

Update

 

I cannot get the wondows box to connect to samba with out the wireless router. As soon as I turn on the wireless router it connects, then I can run \\192.168.1.12\username.

 

I can ping the win7 box from the server, but with out the wireless router I cannot ping the samba server.

 

Is this likely to be a config issue in windows, or is my switch the culpret....Or is there another cause I'm unaware of?

Edited by xboxboy
Link to comment
Share on other sites

If you're losing connectivity when you set up a static IP, then there are possibilities that you didn't configured the default router, and also perhaps your DNS is incorrect as well. You can check this when you have a DHCP address you can then see what your default route is and also what your DNS is. Alternatively, you gave it an IP which conflicted with something on your network already. Best thing to do is find out what DHCP range is configured on your router, and then use an address outside of this range. Or, find out which systems you have and where the IP range starts, and how they increment, and give an address from the other end of the scale.

 

For example, your router is 192.168.1.1 - you get addresses which start at 192.168.1.11, 12, 13 and so on. So you would then use a static IP from the other end of the scale so that it won't conflict, eg: 192.168.1.200. Since it's unlikely you are going to have 190 devices. Or, if your IP DHCP range is 192.168.1.11 to 192.168.1.100, then you can start from 101 for your servers and go up from there.

 

If a system is operating as a server, such as with samba, then yes it's best to have a static IP. You need to give the router as your default gateway, and there is also a possibility that this is also being used for your DNS. Alternatively, you can set the DNS to 8.8.8.8 and 8.8.4.4 for Google DNS, or 208.67.222.222 and 208.67.220.220 for OpenDNS.

Link to comment
Share on other sites

Thanks Ian.

 

I had an IT guru mate of mine around to take a look at it. He checked the logs (var/messages ???) and found that the wireless IP from the win7 machine was allowed through the firewall but the ethernet connection wasn't. I'm not sure why the samba rule wasn't allowing it.

 

He added a rule to allow the ethernet connection through and it all worked.

 

Again, I will test it over a few days to make sure it's solid.

Link to comment
Share on other sites

Quick update. It seems to be pretty sold. I've managed to get the printer system all set on the same network.

 

We put a few whitelist rulings into the firewall to stop all the notifications every 30 seconds. Hopefully on the weekend I'll have time to set it up finally and get everything copied to the server and go live.

 

Thanks for your help Ian.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...