How do I share files over network?

Forum rules
We don't support installations in VirtualBox, VMWare, qemu or others. We ignore posts about WINE, PlayOnLinux, Steam and Skype. We don't support btrfs, lvm, UEFI, side-by-side installations with GPT or dualboot with anything newer than Windows XP.
Google your problem first. Check the Wiki. Read the existing threads. It's okay to "hijack" an existing thread, yes! If your problem is not yet covered, open a new thread. To get the quickest possible help, mention the exact release codename in your post (uname -a is a good idea, too). Due to the lack of crystal balls, attach the output of lspci -nnk if you encounter hardware problems.
wayne
dpkg-reconfigure
Posts: 73
Joined: Sun Nov 25, 2012 1:26 am
Location: Equator

How do I share files over network?

Unread post by wayne » Wed Jan 09, 2013 2:07 pm

Moving this from
http://linuxbbq.org/bbs/posting.php?mod ... f=3&p=1415

Trying to turn an old and low end computer to work as:
a headless box, sitting at a corner, with one 1TB usb disk ,
and use it just to share files over home network with other computers

can it be done? of course with lots of help from forumers here ???:):)

help needed on how to do it..

thanks

dura
Compiler
Posts: 119
Joined: Sun Dec 16, 2012 2:15 am
Location: interzone

Re: How do I share files over network?

Unread post by dura » Wed Jan 09, 2013 2:13 pm

If you don't want to get your hands greasy with samba and want a bit of security you might want to try owncloud. I have found it really good. It has lots of functionality, even media streaming. :)
...oh.

wayne
dpkg-reconfigure
Posts: 73
Joined: Sun Nov 25, 2012 1:26 am
Location: Equator

Re: How do I share files over network?

Unread post by wayne » Wed Jan 09, 2013 2:18 pm

hi dura,

I have no problem to get hand greasy :)
don't mind learn samba and nfs/ssh... per wuxmedia/pidsley reply on the linked post ( annoucement on 'proof')

I just need some step by step guides/tutorial.

User avatar
simgin
Meme Fodder
Posts: 1167
Joined: Sun Jan 06, 2013 12:07 am
Location: Bradford-on-Avon, UK

Re: How do I share files over network?

Unread post by simgin » Wed Jan 09, 2013 2:19 pm

I'm with Wayne, I have had similar thoughts lately.


@dura - thanks for the tip :)
Someone told me that I am delusional, I almost fell off my unicorn.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: How do I share files over network?

Unread post by machinebacon » Wed Jan 09, 2013 3:27 pm

Hi Wayne,

I am pretty sure that these instructions: http://www.debianhelp.co.uk/samba.htm work in Sid, too. And of course the big and mighty Debian Admin Handbook: http://debian-handbook.info/browse/whee ... samba.html
..gnutella..

wayne
dpkg-reconfigure
Posts: 73
Joined: Sun Nov 25, 2012 1:26 am
Location: Equator

Re: How do I share files over network?

Unread post by wayne » Fri Jan 11, 2013 3:42 am

Thanks machinebacon for the links.

I thought just try it out, and run into problems I cannot understand.

google many more tutorials, well, it must be a difficult start, all because of many possibilities, different starting points and the biggest issue is me :(
i get confused by too many terms!! :(


after some trials and errors, I have a nice success for the first time. :)

That is, do the most simple thing:
Share a Publich Folder! with win7 and linux computer on same network.
no need password, no need users. at least that is good for a start..
of course it is not secured, because everyone can read, write and modify.

Let me just summarise my steps here, as I think I will need to refer to it again and again.. and might be useful for another person like me ..


1. My starting point:
a. install linuxbbq-proof.iso to hard disk
b, use ceni to activate my network
c. for me, i am familiar using iceweasel so I install it.
d. install flashplugin-nonfree so that I can watch youtube tutorials.

2. Install samba

Code: Select all

apt-get install samba samba-common-bin
3. Backup samba configuration file. /etc/samba/smb.conf
it is best to backup the original file because many changes during trials and errors as part of learning process .

Code: Select all

# cp /etc/samba/smb.conf  /etc/samba/smb.bak

4. I use this tutorial to start learning simple thing
http://www.youtube.com/watch?v=gJs2YAnX2_k
I just change the folder 'test' to 'Public Share'

let's make the first config change

Code: Select all

# nano /etc/samba/smb.conf
move cursor to, place it above the lines below,
# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
type in these lines, or copy these lines from code tags below and paste to

Code: Select all

[Public_Share]
comment = a Public_Share  folder for guest with read/write/ modify rights
path = /mnt/Public_Share
public = yes
read only = no
now, exit nano by three actions on keyboard
<ctrl-x>
<y>
<Enter>

this will bring you back to root terminal #

5. create the Public_Share folder under /mnt and change mode

Code: Select all

# mkdir /mnt/Public_Share

Code: Select all

# chmod 777 /mnt/Public_Share
6. now, restart samba service with this command

Code: Select all

# /etc/init.d/samba restart
terminal would show
root@grill:/home/bbq# /etc/init.d/samba restart
[ ok ] Stopping Samba daemons: nmbd smbd.
[ ok ] Starting Samba daemons: nmbd smbd.

7. Test Public_Share folder on Proof (GRILL) /Win7/ Linux computer
after some waiting time ( may be few minutes?), the win7 and linux computers on the same network should already be able to see the name of this computer!
Since this computer with linuxbbq-proof has hostname
root@grill:/home/bbq# hostname
grill
now I can see 'grill' as an icon in win7/linux computers

for win7 : Start>Computer>Network>GRILL
for Linuxbbq-xfce box :Menu>File Manager>Browse Network>GRILL

double click GRILL, it should show Public_Share folder

I tested write/read for all three computers, all workings

I am happy.. learn something useful..
at least can share folder in the network.



8 Read many other post too, and usually they suggest to do a test on configuration using 'testparn', i cannot understand much but just post what it looks like for me and other new users

Code: Select all

root@grill:/home/bbq# testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[homes]"
Processing section "[printers]"
Processing section "[Public_Share]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
upon hitting <Enter>, terminal show below:
[global]
server string = %h server
map to guest = Bad User
obey pam restrictions = Yes
pam password change = Yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
unix password sync = Yes
syslog = 0
log file = /var/log/samba/log.%m
max log size = 1000
dns proxy = No
usershare allow guests = Yes
panic action = /usr/share/samba/panic-action %d
idmap config * : backend = tdb

[homes]
comment = Home Directories
valid users = %S
create mask = 0700
directory mask = 0700
browseable = No

[printers]
comment = All Printers
path = /var/spool/samba
create mask = 0700
printable = Yes
print ok = Yes
browseable = No

[Public_Share]
comment = a Public_Share folder for guest with write/read/modify rights
path = /mnt/Public_Share
read only = No
guest ok = Yes

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
root@grill:/home/bbq#
Last edited by wayne on Sat Jan 12, 2013 12:44 pm, edited 1 time in total.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: How do I share files over network?

Unread post by machinebacon » Fri Jan 11, 2013 4:49 am

Wayne,

thanks a lot for the instructions, I propose this as wiki entry :)

Might be interesting to know if these work like this in XP, too. I guess they do ;)

Cheers!
..gnutella..

wayne
dpkg-reconfigure
Posts: 73
Joined: Sun Nov 25, 2012 1:26 am
Location: Equator

Re: How do I share files over network?

Unread post by wayne » Fri Jan 11, 2013 8:09 am

Hi machinebacon,

I do not have WinXP to test, so can't say much.

And this is my first 'anyhow-do' job, don't think it is qualified for wiki..

perhaps wait for someone els such as wuxmedia to check and modify.
wuxmedia commented and made some good recommendation on a tutorial, quoted below
i can help with samba - it's been a while.

i found the easiest way was to remove all security though.
makes it easier for users and admins alike.

i'll guess i'll put my efforts into writing a wiki article otherwise i'll only end up migrating it anyway.

you can do as pidsley says -good to start stuff in ssh. and nfs is quite easy.


that should get you going...
actually this is a pretty (old) but good guide, should give you an idea of what you will have to do.
http://www.unixmen.com/standalone-samba ... n-squeeze/

good luck



To continue, now I am trying to follow the tutorial link provided by wuxmedia above...

This time, I try to make a Password Protected Sharing, meaning user s from win7 and linux accessing Proof's 'GRILL' need to enter a name and password .

I still do not understand most of it , LOL, but just do it , like your quote , :)

The steps I follow, with some adjustment are below:

1. Before making changes, backup my 'working smb.conf' file for Public_Share

Code: Select all

# cp /etc/samba/smb.conf  /etc/samba/smb.public
2. Edit smb.conf to activate the line security = user,

Code: Select all

# nano /etc/samba/smb.conf
by simply locate those lines below,
remove the # on security = user line , so that it will become like this
####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
security = user

# You may wish to use password encryption. See the section on

follow by adding at the end of the file smb.conf below

Code: Select all

[PwpShare]
comment = All Users with name and password
path = /mnt/PwpShare
valid users = @users
force group = users
create mask = 0660
directory mask = 0771
writable = yes

save and exit nano (ctrll-x,y,enter)

3. restart sambe service

Code: Select all

# /etc/init.d/samba restart
4. Add samba share directory , i called it PwpShare, so as to distinguised with Public_Share. and change the group to users group

Code: Select all

# mkdir -p /mnt/PwpShare
# chown -R root:users /mnt/PwpShare
# chmod -R ug+rwx,o+rx-w /mnt/PwpShare

5. Add and manage the Users

I would add a user name 'acer' so those command below works for 'acer'.
To add other users, just replay 'acer' on the commands with the desired names. and enter the password when prompted twice.

# useradd acer -m -G users

set password for user 'acer'

Code: Select all

root@grill:/home/bbq# useradd acer -m -G users
root@grill:/home/bbq# passwd acer
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

Now add the user to the samba user database:

Code: Select all

root@grill:/home/bbq# smbpasswd -a acer
New SMB password:
Retype new SMB password:
Added user acer.

6. Now win7/linux computer should be able to login in with the user name acer and its password

one thing I found is, during testing, win7 machine can see the more things than I wish :) :)

I hope wuxmedia or some other people can help me figure out what happen and how to make appropriate changes.
could be something to do with user/group which i am totally do not understand :(, as I said I just follow tutorial.. LOL.

What win7 see is

Network>GRILL> and three directories

acer
Public_Share
PwpShare

the one I do not expect is acer
it has subdirectory

bin
Desktop
Downloads
firmware-b43
Images
Music
Videos



Thanks for reading such a long post..
at least I can share with win7/linux with user and password..
a little progress..
Last edited by wayne on Sat Jan 12, 2013 12:34 am, edited 1 time in total.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: How do I share files over network?

Unread post by machinebacon » Fri Jan 11, 2013 8:46 am

The user 'acer' was created and so the system has made a new accont based on the contents of the /etc/skel folder

If you move into /home/acer you see that all directories are 'original' (the firmware folder for example contains the stuff for broadcom cards)

The user 'acer' has all rights of being read from and written to, as you first created the user:
useradd acer -m -G users
and added him to the Samba database.

It is a shared folder (/home/acer).
..gnutella..

wayne
dpkg-reconfigure
Posts: 73
Joined: Sun Nov 25, 2012 1:26 am
Location: Equator

Re: How do I share files over network?

Unread post by wayne » Fri Jan 11, 2013 1:48 pm

Might be interesting to know if these work like this in XP, too. I guess they do ;)
hi machinebacon,

well, luck is with me : LOL

a friend's laptop with winXP could not boot, brought to my house, got it repaired.

so , have a chance to setup WinXP network..

and, all seem working, WinXP can write/read/change on Public_Share.
and it can login with 'acer + acer's pw' and share on PwpShare.

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: How do I share files over network?

Unread post by rhowaldt » Fri Jan 11, 2013 3:53 pm

wayne, that Samba stuff is going on the Wiki, especially if you get to test it with XP as well. make sure to give us one of those nice how-to's you do and i will transfer that bunch to the Wiki :)
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: How do I share files over network?

Unread post by machinebacon » Fri Jan 11, 2013 4:13 pm

^ I thought the same. More power to the people! :raised_spatula:
..gnutella..

pidsley
Hermit
Posts: 2539
Joined: Wed Oct 17, 2012 12:31 pm

Re: How do I share files over network?

Unread post by pidsley » Fri Jan 11, 2013 5:13 pm

Nice work Wayne. samba makes my brain hurt :)

User avatar
wuxmedia
Grasshopper
Posts: 6454
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: How do I share files over network?

Unread post by wuxmedia » Fri Jan 11, 2013 8:57 pm

nice work, wayne - you've put me to shame. 8)
i definitely second (third?) this as a WIKI entry. saves me doing it. 8P
It's also very well written and if people are doing it from the first time, having a first timer explain it works very well, on the same level.
actually i'm glad you found your own path. i'm sure you will walk many others. 8)
"Seek, and Ye shall find"
"Github | Chooons | Site"

wayne
dpkg-reconfigure
Posts: 73
Joined: Sun Nov 25, 2012 1:26 am
Location: Equator

Re: How do I share files over network?

Unread post by wayne » Sun Jan 13, 2013 4:50 pm

rhowaldt wrote:wayne, that Samba stuff is going on the Wiki, especially if you get to test it with XP as well. make sure to give us one of those nice how-to's you do and i will transfer that bunch to the Wiki :)
@rhowaldt,
OK, tested with another debian based distros, with the same instructions.
all works fine.
What do I need to do on How to?

@pidsley
samba makes my brain hurt :)
my head and eyes hurt a lot. LOL
especially got confused by many forums and most of them give some problem here and there.

Read from one forum, the person said he can start from fresh install and get it works in less than 5 minutes.... Now I believe what he said. after getting those steps which were repeated in many places..
Got to start from the right place and do thing simple..
It turns out that dealing directly with terminal commands and make change to smb.conf is much faster than using several GUI based stuff, often take a lot longer to understand.

@wuxmedia, LOL, passing the ball?
please just proof read, thanks much.

I have not yet settle on second hard disk sharing and USB drive sharing..

OK now I am going to next step.

that is
1. I keep one hard disk 40G as OS, multiboot for test and learning as well
2. Second internal disk, 40G, now ntfs format , since there is no more WinOS, (winXP too slow on this celeron single core cpu and only integrated graphic)
So I am thinking to simply format the whole drive as ext4, then make it as data drive, and just need a little help to auto mount it on reach reboot, so that the directories would become availables for networking sharing

How could I do it and how to change /etc/fstab?

3. External USB drive.
Got it during xmas present, 1TB wow.
This USb drive will be NTFS format since it would also be unplug and plug into some Win7 laptop/desktop just for copying files, sharing etc.
How could I ensure that it is easily 'automount' when I plug into the 'headless box'?

4. autologin, no issue following machinebacon instruction on my earlier post
http://linuxbbq.org/bbs/viewtopic.php?f=7&t=63

Thanks for the help.

User avatar
rhowaldt
Dog
Posts: 4565
Joined: Wed Oct 17, 2012 9:01 am
Contact:

Re: How do I share files over network?

Unread post by rhowaldt » Sun Jan 13, 2013 5:39 pm

still waiting for that WinXP bit, but will add it once you post it wayne. for now, check it out: http://linuxbbq.org/wiki/index.php?title=Samba
(modified for the Wiki of course)

thanks!
All statements are true in some sense, false in some sense, meaningless in some sense, true and false in some sense, true and meaningless in some sense, false and meaningless in some sense, and true and false and meaningless in some sense.

User avatar
wuxmedia
Grasshopper
Posts: 6454
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: How do I share files over network?

Unread post by wuxmedia » Sun Jan 13, 2013 9:43 pm

cheers wayne, looks great to me...

2. for fstab/automounting (for permanent/internal hdds) some kind soul (so, not me) has posted this on the wiki;
http://linuxbbq.org/wiki/index.php?title=Mount

3. found this on the internet.
http://linuxconfig.org/automatically-mo ... ith-autofs
skip to section 2. not tried it will do as i'm getting slightly tired of mounting DVDs which could be either IS09660 or UDF, depending on who and when they were burnt.


hint; once you've got to grips with mount and fstab, you can mount your network drives, on your other machines automagically. samba and nfs, so your laptop/desktop can access your shares, like any other folder in your home dir...

PS rhow the samba instructions there will work fine with XP and 98 for that matter. peering around the samba site - it should even work with win3.11 8)
Last edited by wuxmedia on Sun Jan 13, 2013 9:59 pm, edited 1 time in total.
"Seek, and Ye shall find"
"Github | Chooons | Site"

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: How do I share files over network?

Unread post by machinebacon » Sun Jan 13, 2013 9:53 pm

3. should be taken over automatically by udisks:

Code: Select all

sudo leafpad /usr/share/polkit-1/actions/org.freedesktop.udisks.policy 
lines 22, 86, 133, 147:

Code: Select all

      <allow_active>yes</allow_active>
Is usually default at BBQ ;)
..gnutella..

User avatar
wuxmedia
Grasshopper
Posts: 6454
Joined: Wed Oct 17, 2012 11:32 am
Location: Back in Blighty
Contact:

Re: How do I share files over network?

Unread post by wuxmedia » Sun Jan 13, 2013 10:23 pm

not my thread, but udisks didn't get my DVDs auto-mounted. on 3some.
doesn't thunar automount disks. ?

EDIT. yes thunar mounts dvds happily into /media/disc_name
admittedly 8Mbs of d/l... still better than 23Mb of nautilus.
"Seek, and Ye shall find"
"Github | Chooons | Site"

machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

Re: How do I share files over network?

Unread post by machinebacon » Mon Jan 14, 2013 1:08 am

why dvd?
OP refers to an external usb hard drive, 1TB in size. that is a case for udisks.
..gnutella..

Post Reply