Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
How to share directories in LAN?
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Thu Apr 24, 2014 2:02 pm    Post subject: How to share directories in LAN? Reply with quote

Hi,

How to share directories in Local Network - It is a simple sharing, between machines which connected to the same router.
I installed Samba according this HowTo and it is working, but the smb.conf file found in this HowTo - http://wiki.gentoo.org/wiki/Samba/HOWTO -
not suitable for me or I do not know how to adjust it with my data - Please inform me with smb.conf that would be relevant to my simple sharing.

The result should be - Ability to see and transfer files between machines of the same Local Network.

EDIT: When I press on Network>Network Services in Dolphin I get this message: 'KDE has been built without Zeroconf support.' -
Should I install 'dev-dotnet/mono-zeroconf' or 'kde-base/zeroconf-ioslave [ Masked ]'?
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Thu Apr 24, 2014 4:15 pm    Post subject: Re: How to share directories in LAN? Reply with quote

pmam wrote:
Hi,

How to share directories in Local Network - It is a simple sharing, between machines which connected to the same router.
I installed Samba according this HowTo and it is working, but the smb.conf file found in this HowTo - http://wiki.gentoo.org/wiki/Samba/HOWTO -
not suitable for me or I do not know how to adjust it with my data - Please inform me with smb.conf that would be relevant to my simple sharing.

The result should be - Ability to see and transfer files between machines of the same Local Network.

EDIT: When I press on Network>Network Services in Dolphin I get this message: 'KDE has been built without Zeroconf support.' -
Should I install 'dev-dotnet/mono-zeroconf' or 'kde-base/zeroconf-ioslave [ Masked ]'?


I use a public directory set up in /etc/samba.smb conf as follows:
Code:

# A publicly accessible directory, read/write to all users. Note that all files
# created in the directory by users will be owned by the default user, so
# any user with access can delete any other user's files. Obviously this
# directory must be writable by the default user. Another user could of course
# be specified, in which case all files would be owned by that user instead.
# The default create mask is 0744.  The default force create mode is 0000.
[public]
    comment = Public directory
    path = /home/public
    public = yes
    guest ok = yes
    guest only = yes
    writable = yes
    printable = no
    create mask = 0644
    force create mode = 0660

The directory itself has permissions:
Code:

drwxrwsr-x 2 guest users 4096 2013-12-30 20:42 /home/public

where a typical user belongs to the "users" group.

That works for various version of Windows and Linux.

Will
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Thu Apr 24, 2014 7:55 pm    Post subject: Reply with quote

Will Hi,

I am quite lost in this sharing issue... I followed the HowTo Samba but I think it is not so clear,
at least for someone like me, that doing it first time. Anyway, something is missing and I do not know what.
I tried to edit smb.conf and put only the code you post here - Is it enough or I need to add something to this file?
Also, my path is a little different from yours (but I created a /home/public directory like yours for the testing) - My is: /home/my_username/public.
Here are the things I have done according this HowTo:
Code:
emerge --ask net-fs/samba
root # mkdir /etc/samba/printer
root # mkdir /var/spool/samba
root # mkdir /home/samba/public
root # mkdir /home/samba
root # mkdir /home/samba/public
root # chmod 755 /home/samba
root # chmod 755 /home/samba/public

Initiating samba service - I have one machine with systemd so:
Code:
systemctl enable smbd.service
systemctl enable nmbd.service

And start them. For the other machine with openRC:
Code:
root # rc-update add samba default
root # /etc/init.d/samba start


I checked with this command from the HowTo and it seems OK - /usr/bin/testparm.
Please advise!

Thanks
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Fri Apr 25, 2014 12:32 pm    Post subject: Reply with quote

I do not know how to work it out...
There is 'share' feature in DE settings -Should I use it together with samba?
Oh, I made a salad of all this sharing - All I wanted is to share directories between Linux machines...
Can someone help with a few lines of the necessary steps to do in order to dance Samba...
Please advise!

BTW: I could not connect Gentoo's Forum for long time today - Is it global problem or only local?
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Sat Apr 26, 2014 2:18 pm    Post subject: Reply with quote

There should be a full smb.conf.default in your /etc/samba directory; the code I posted
is just a stanza to share a directory (any directory can be shared, the name doesn't matter,
it just has to have the right permissions). There are several like it towards the end of
smb.conf.default.

The default smb.conf is pretty long, but the defaults work and it doesn't need much
editing - the changes I've made are all toward the head of the file:
Code:

#======================= Global Settings =====================================
[global]

# 1. Server Naming Options:
# workgroup = NT-Domain-Name or Workgroup-Name
    workgroup = WORKGROUP

# netbios name is the name you will see in "Network Neighbourhood",
# but defaults to your hostname
;   netbios name = <name_of_this_server>
   netbios name = MOULDYWARP

# server string is the equivalent of the NT Description field
    server string = Samba Server %v

# 2. Printing Options:
# CHANGES TO ENABLE PRINTING ON ALL CUPS PRINTERS IN THE NETWORK
# if you want to automatically load your printer list rather
# than setting them up individually then you'll need this
    printcap name = cups
    load printers = yes

# It should not be necessary to spell out the print system type unless
# yours is non-standard. Currently supported print systems include:
# bsd, sysv, plp, lprng, aix, hpux, qnx, cups
    printing = cups

# 3. Logging Options:
# this tells Samba to use a separate log file for each machine
# that connects
    log file = /var/log/samba/log.%m

# Put a capping on the size of the log files (in Kb).
    max log size = 50

# Set the log (verbosity) level (0 <= log level <= 10)
;  log level = 3

# 4. Security and Domain Membership Options:
# This option is important for security. It allows you to restrict
# connections to machines which are on your local network. The
# following example restricts access to two C class networks and
# the "loopback" interface. For more examples of the syntax see
# the smb.conf man page. Do not enable this if (tcp/ip) name resolution does
# not work for all the hosts in your network.
;   hosts allow = 192.168.1. 192.168.2. 127.

# Uncomment this if you want a guest account, you must add this to /etc/passwd
# otherwise the user "nobody" is used
    guest account = guest
# Allow unknown users to map to guest:
    map to guest = bad user


(and my earlier public directory stuff is tacked on the end).

Will
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Sat Apr 26, 2014 2:38 pm    Post subject: Reply with quote

@pmam, if you're truly only wanting to share between Linux machine, Samba is not the optimal solution as it presents a Windows-centric filesystem view. What you want is NFS. See the NFSv4 topic on the Gentoo Wiki.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Sat Apr 26, 2014 7:32 pm    Post subject: Reply with quote

Dear John,

Quote:
What you want is NFS. See the NFSv4 topic on the Gentoo Wiki.

Yes, that what was missing to me - I thought Samba is the only solution for Linux and for Windows -
but after your post I see that if all machines are Linux, It is preferred to use NFS - You really put your finger on my confusion... and you deserve to a lot of thanks :)
Actually this is the situation right now - all machines are Linux - But there are some points to consider:
First, I have a TV receiver that based on Linux image - I know that it has Samba installed, and there is an option to choose NFS or CIFS sharing -
OK - I need to choose NFS, but what happens if a machine has NFS and Samba - which sharing system is active - they can work together?
Second, In the future I will add Windows machine so it means I will need Samba, as well - so I will try to follow Will's tip.
Anyway - I starting to follow the NFSv4 topic on Gentoo Wiki that you gave me, but get the following mounting problem of 'data' directory:
Code:
mount --bind /home /export/home && mount --bind /data /export/data
mount: special device /data does not exist

Do not know why home mounts ok but data not??

Dear Will,

Thanks for your smb.conf example - I will try to implement it -
I think that in addition to the right smb.conf, I do not know how to define the right permission of the directory and the users, as you noted:
Quote:
it just has to have the right permissions


Thanks you all
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Sat Apr 26, 2014 7:56 pm    Post subject: Reply with quote

pmam wrote:
Do not know why home mounts ok but data not??
Could you post the output of
Code:
ls -ld /data /export
please?

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Sat Apr 26, 2014 8:17 pm    Post subject: Reply with quote

Dear John,

Strange... I followed NFS Wiki and did this command (now it is the second time... so it says 'File exists'):
Code:
 cd /export && mkdir {home,data}
mkdir: cannot create directory ‘home’: File exists
mkdir: cannot create directory ‘data’: File exists

So why your command says 'No such directory'??
Code:
 ls -ld /data /export
ls: cannot access /data: No such file or directory
drwxr-xr-x 4 root root 4096 Apr 26 21:42 /export

And here is the comman ls -l:
Code:
ls -l
total 8
drwxr-xr-x 2 root root 4096 Apr 26 21:42 data
drwxr-xr-x 6 root root 4096 Apr 24 22:35 home


Thanks
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Sat Apr 26, 2014 8:22 pm    Post subject: Reply with quote

Because /data doesn't exist. Just create it.
Code:
mkdir /data
Then your bind mount will succeed.

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.


Last edited by John R. Graham on Sat Apr 26, 2014 9:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Sat Apr 26, 2014 9:09 pm    Post subject: Reply with quote

Dear John,

OK, I created data directory (I thought this command: cd /export && mkdir {home,data} suppose to do it - Still there is a long way for me... :) ),
and bind is OK. Now I need to start NFS - What is the relevant command for Systemd instead of: /etc/init.d/nfs start?
Did not find this service for Systemd...

EDIT: BTW - This data directory should be created under /export - so the result is /export/data - Is it right?

EDIT: Sorry... I missed the first line of NFS Wiki - 'install net-fs/nfs-utils' - Ignore this post :cry:

Thanks
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”


Last edited by pmam on Sat Apr 26, 2014 10:09 pm; edited 1 time in total
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10587
Location: Somewhere over Atlanta, Georgia

PostPosted: Sat Apr 26, 2014 10:01 pm    Post subject: Reply with quote

Sorry; I don't speak systemd. Regarding your question about /data vs. /export/data, apparently the guide is showing you an example, not saying this is how you have to do it. (Which makes sense, right?) It's good to collect all of the exported directories in /export but they may not actually be there. Say you have a directory you want to export named, oh, let's choose an example at random, say /data. But the standard export location is /export. The solution is to --bind mount /data to /export/data, which is what this command on the Wiki
Code:
mount --bind /data /export/data
did. ;)

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Sat Apr 26, 2014 10:07 pm    Post subject: Reply with quote

Dear John,

OK, now I see...I am not familiar with this '--bind mount' so it confused me...
Please see also my last EDIT on my last post...
I will continue with Sytemd, and also with my other machine with openRC

Thanks a lot
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Sun Apr 27, 2014 6:03 am    Post subject: Reply with quote

Dear Will,

Quote:
There should be a full smb.conf.default in your /etc/samba directory;

Yes, I already tried this example without success...

I edited smb.conf with the the code in your last post and the public directory at the end, but still it is not working -
Maybe something wrong with my user permissions, I do not know... - How can I check it?
Anyway, I'm trying to debug it and here are outputs according the HowTo - Maybe it can helps:
Code:
/usr/bin/testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[public]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
   server string = Samba Server %v
   map to guest = Bad User
   guest account = guest
   log file = /var/log/samba/log.%m
   max log size = 50
   printcap name = cups
   idmap config * : backend = tdb

[public]
   comment = Public directory
   path = /home/public
   read only = No
   create mask = 0644
   force create mode = 0660
   guest only = Yes
   guest ok = Yes

And here it is failed:
Code:
smbclient -L localhost
Enter root's password:
Connection to localhost failed (Error NT_STATUS_CONNECTION_REFUSED)

Is there another way to debug?

Thanks
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Sun Apr 27, 2014 11:30 am    Post subject: Reply with quote

Dear John,

In NFSv4 Wiki there are two configurations of /etc/fstab:
For server is:
Code:
/home    /export/home   none    bind  0  0
/data    /export/data   none    bind  0  0

And for client is (BTW: there is another option for client):
Code:
server:/         /mnt     nfs     rw,_netdev,auto   0  0

My target is to have some Linux machines connected to the same LAN,
with ability to see and transfer between them any files from /home - This is not so ambitious - right?
As far as I understand, it means - Each machine can be server or client sometime - So please let me know what configuration I need to choose?

As for your previous post - I understood that Wiki gives a suggestion only, with data directory etc -
However due to my target as described above - Please let me know your suggestion for /export?

Thanks
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Sun Apr 27, 2014 8:32 pm    Post subject: Reply with quote

pmam wrote:
Dear Will,

....

And here it is failed:
Code:
smbclient -L localhost
Enter root's password:
Connection to localhost failed (Error NT_STATUS_CONNECTION_REFUSED)

Is there another way to debug?

Thanks


It looks as if Samba is working, but can't find localhost for some reason; it might not recognise
the name. You could try the -I option to smbclient (man smbclient for more information). If that
works it's a question of finding out how Samba gets the name of the client system.

Will

AFAIK you can crank up the logging level with:
Code:

# Set the log (verbosity) level (0 <= log level <= 10)
  log level = 3

in smb.conf
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3095

PostPosted: Mon Apr 28, 2014 6:27 pm    Post subject: Reply with quote

Quote:
It looks as if Samba is working, but can't find localhost for some reason;

is there a line
127.0.0.1 localhost
in /etc/hosts?
Is local loopback up?

also, in mixed networks (linux, windows and perhaps others) FTP is pretty convenient. To share fiels with it you will likely want to add a user for this purpose (either `anonymous` if you want it to be completly open or for example `ftp` if it's for friends only) and store files in /home/<your choosen username>. For purely personal use you can login wit your own login and password, but keep in mind FTP sends everything in plain text.

For linux-only file shareing NFS seems to be even easier though
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Wed Apr 30, 2014 8:36 am    Post subject: Reply with quote

Dear Szatox,

I did not get any email alert regarding your reply (instead I got a spam email with this title: 'This Mother's Day, get her the gift of spam, spam, spam, ...' :) ) -
So sorry for my delay response...

It seems that you, incorporate with Cwr and John, put the finger on the right place - There is an important improvement as you can see in the following outputs below.
I checked /etc/hosts and remove # from 127.0.0.1 localhost (it was comment) - I did not know it is needed, and do not remember if it is with # or not in the default example of /etc/hosts, that comes with Gentoo's installation. Now these lines are like this:
Code:
# IPv4 and IPv6 localhost aliases
127.0.0.1   localhost
::1      localhost

Hope now is ok - Please explain what do you mean by:
Quote:
Is local loopback up?
And if you can give a short explanation or a link of this issue!
When I use smb.conf.default from /etc/samba directory, as smb.conf, it does not work, but when I use the below smb.conf, that I copied from my old machine - Suse/openRC (with a little change: security=user instead of share) - It is working as you can see from the outputs afterword. Please let me know why smb.conf.default from /etc/samba directory does not work - It is important to me to figure out this issue!

Code:

[global]

   workgroup = WORKGROUP

   server string = mg_6300

   security = user

   map to guest = Bad User

      os level = 2

   preferred master = No

   local master = No

   domain master = No

      cups options = raw

   usershare max shares = 100

   restrict anonymous = no

   usershare allow guests = yes

   idmap config * : backend = tdb

   



[printers]

   comment = All Printers

   path = /var/tmp

   create mask = 0600

   printable = Yes

   browseable = No



[print$]

   comment = Printer Drivers

   path = /var/lib/samba/drivers

   write list = @ntadmin, root

   force group = ntadmin

   create mask = 0664

   directory mask = 0775



[home]

   path = /home

   read only = No

   guest ok = Yes

   force user = mg

   force group = users

   comment = all users

   public = yes



[store]

   path = /mnt/store/

   read only = No

   guest ok = Yes

   force user = mg

   force group = users

   public = yes

Code:
/usr/bin/testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[printers]"
Processing section "[print$]"
Processing section "[home]"
Processing section "[store]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
        server string = mg
        map to guest = Bad User
        os level = 2
        local master = No
        domain master = No
        usershare allow guests = Yes
        usershare max shares = 100
        idmap config * : backend = tdb
        cups options = raw

[printers]
        comment = All Printers
        path = /var/tmp
        create mask = 0600
        printable = Yes
        print ok = Yes
        browseable = No

[print$]
        comment = Printer Drivers
        path = /var/lib/samba/drivers
        write list = @ntadmin, root
        force group = ntadmin
        create mask = 0664
        directory mask = 0775

[home]
        comment = all users
        path = /home
        force user = mg
        force group = users
        read only = No
        guest ok = Yes

[store]
        path = /mnt/store/
        force user = mg
        force group = users
        read only = No
        guest ok = Yes

Code:
smbclient -L localhost
Enter root's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.23]

        Sharename       Type      Comment
        ---------       ----      -------
        print$          Disk      Printer Drivers
        home            Disk      all users
        store           Disk     
        IPC$            IPC       IPC Service (mg)
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.23]

        Server               Comment
        ---------            -------

        Workgroup            Master
        ---------            -------
        MYGROUP              MG_6300
        WORKGROUP            MG_HOST


Now I want to give the machines details: All the above refers to the KDE/openRC machine! I have another machine - Gnome/Systemd that I am trying to install Samba sharing, as well - For this Systemd's machine, the smb.conf of KDE/openRC does not work, so I copied from another old machine Suse/Systemd. I had two types of smb.conf from Suse/Systemd, so you can see the different outputs of smbclient -L localhost:

The first Systemd's smb.conf:
Code:
[global]

   workgroup = WORKGROUP

   server string = mg_host

   security = user

   map to guest = Bad User

   os level = 2

   preferred master = No

   local master = No

   domain master = No

   cups options = raw

   restrict anonymous = no

   



[printers]

   comment = All Printers

   path = /var/tmp

   create mask = 0600

   printable = Yes

   browseable = No



[print$]

   comment = Printer Drivers

   path = /var/lib/samba/drivers

   write list = @ntadmin, root

   force group = ntadmin

   create mask = 0664

   directory mask = 0775



[home]

   path = /home

   read only = No

   guest ok = Yes

   force user = mg

   force group = users

   comment = all users

   public = yes

Code:
/usr/bin/testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[printers]"
Processing section "[print$]"
Processing section "[home]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
   server string = mg_host
   map to guest = Bad User
   os level = 2
   local master = No
   domain master = No
   idmap config * : backend = tdb
   cups options = raw

[printers]
   comment = All Printers
   path = /var/tmp
   create mask = 0600
   printable = Yes
   print ok = Yes
   browseable = No

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/drivers
   write list = @ntadmin, root
   force group = ntadmin
   create mask = 0664
   directory mask = 0775

[home]
   comment = all users
   path = /home
   force user = mg
   force group = users
   read only = No
   guest ok = Yes

Code:
smbclient -L localhost
Enter root's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.23]

   Sharename       Type      Comment
   ---------       ----      -------
   print$          Disk      Printer Drivers
   home            Disk      all users
   IPC$            IPC       IPC Service (mg_host)
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.23]

   Server               Comment
   ---------            -------
   MG_6300              mg_6300
   MG_HOST              mg_host

   Workgroup            Master
   ---------            -------
   WORKGROUP            MG_HOST


The second Systemd's smb.conf
Code:
# smb.conf is the main Samba configuration file. You find a full commented

# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the

# samba-doc package is installed.

[global]

   workgroup = WORKGROUP

              server string = mg_host

   passdb backend = tdbsam

        security = user

        map to guest = Bad User

   printing = cups

   printcap name = cups

   printcap cache time = 750

   cups options = raw

   include = /etc/samba/dhcp.conf

   logon path = \\%L\profiles\.msprofile

   logon home = \\%L\%U\.9xprofile

   logon drive = P:

   usershare allow guests = Yes

[home]

   comment = all users

   path = /home/mg

   read only = No

   guest ok = Yes

   force user = mg

   force group = users

   public = yes

   

[printers]

   comment = All Printers

   path = /var/tmp

   printable = Yes

   create mask = 0600

   browseable = No



[print$]

   comment = Printer Drivers

   path = /var/lib/samba/drivers

   write list = @ntadmin root

   force group = ntadmin

   create mask = 0664

   directory mask = 0775

Code:
/usr/bin/testparm
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Can't find include file /etc/samba/dhcp.conf
Processing section "[home]"
Processing section "[printers]"
Processing section "[print$]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions

[global]
   server string = mg_host
   map to guest = Bad User
   printcap name = cups
   logon path = \\%L\profiles\.msprofile
   logon drive = P:
   logon home = \\%L\%U\.9xprofile
   usershare allow guests = Yes
   idmap config * : backend = tdb
   cups options = raw

[home]
   comment = all users
   path = /home/mg
   force user = mg
   force group = users
   read only = No
   guest ok = Yes

[printers]
   comment = All Printers
   path = /var/tmp
   create mask = 0600
   printable = Yes
   print ok = Yes
   browseable = No

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/drivers
   write list = @ntadmin, root
   force group = ntadmin
   create mask = 0664
   directory mask = 0775

Code:
smbclient -L localhost
Enter root's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.23]

   Sharename       Type      Comment
   ---------       ----      -------
   IPC$            IPC       IPC Service (mg_host)
   print$          Disk      Printer Drivers
   home            Disk      all users
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.23]

   Server               Comment
   ---------            -------
   MG_HOST              mg_host

   Workgroup            Master
   ---------            -------
   WORKGROUP           


Summery of this long story: According the above outputs, It seems that it is working, but I do not know where I can see the other machine in the network - When I enter 'Network' in Dolphin - I do not see it?? In the HowTo Wiki Samba they create directory: /home/samba/public - maybe it is just an example, and I did it - However, I do not know if it is necessary due to my target, as I described in previous post - To see and transfer files from /home directories between each machine.

FTP: Yes I know this option (like filezilla) but as you said NFS easier - However, I do not know what are the equivalent Systemd's services needed instead of '/etc/init.d/nfs start' - You may see my separate Topic regarding this issue.

Thanks a lot
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Thu May 01, 2014 1:33 pm    Post subject: Reply with quote

Hi,

Regarding NFS: I had some mistakes in configuration, and found the relevant services for NFS/Systemd - I followed NFS Wiki and now can see and share home directory of my machine (server) from my SAT TV receiver (client).
However - I do not know why can not see and share directories between two Linux machines - One is Gnome/Systemd and the other is KDE/openRC??
Maybe something missing regarding the configuration of Server and Client - Should I define one machine as a Server and the other as Client, or both of them can be Server and Client? Actually, each machine sometime is Server and sometime is Client - Right?
As far as I know, when NFS is working I can see and transfer files between Linux machines by enter the 'Network' in Dolphin - Right? Or there is another way to do it?
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Thu May 01, 2014 7:19 pm    Post subject: Reply with quote

Hi,

I can see Samba's share directories from my Linux's SAT TV receiver, but can not mount them -
I saw this mount command in HowTo Smaba:
Code:
 mount -t cifs [-o username=xxx,password=xxx] //server/share /mnt/point

and if we ignore Windows/cifs at the moment, and focus on Linux share with Samba -
Should I add any mount command to fstab in order to enable mounting from my SAT receiver?
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Fri May 02, 2014 9:13 am    Post subject: Reply with quote

Still can not establish Samba sharing...
Here is a command I took from this HowTo: http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/install.html -
Maybe the failure output can help:
Code:
smbclient  //mg_host/mg
Enter root's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.23]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

Please advise!
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
cwr
Veteran
Veteran


Joined: 17 Dec 2005
Posts: 1969

PostPosted: Sat May 03, 2014 2:43 pm    Post subject: Reply with quote

pmam wrote:
Still can not establish Samba sharing...
Here is a command I took from this HowTo: http://www.samba.org/samba/docs/man/Samba-HOWTO-Collection/install.html -
Maybe the failure output can help:
Code:
smbclient  //mg_host/mg
Enter root's password:
Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.23]
tree connect failed: NT_STATUS_BAD_NETWORK_NAME

Please advise!


The fstab entry I use to export a Samba directory is:
Code:

# farthing's public Samba directory.
//farthing/public /home/farthing cifs guest,sec=none,uid=1001,gid=100,dir_mode=0775,file_mode=0664,noauto 0 0

"mount /home/farthing" then gets me the exported directory, with pretty low security, but it's on a network disconnected
from the Internet.

As far as the network name is concerned, you may need something like the following in /etc/samba/smb.conf:
Code:

# 1. Server Naming Options:
# workgroup = NT-Domain-Name or Workgroup-Name
    workgroup = WORKGROUP

# netbios name is the name you will see in "Network Neighbourhood",
# but defaults to your hostname
;   netbios name = <name_of_this_server>
   netbios name = SIXPENCE

(Note the capitals - the Unix name is "sixpence").


Will
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Mon May 26, 2014 11:28 am    Post subject: Reply with quote

I made a nice progress regarding NFS, however, there are some issues:

As John noted earlier in this topic, the example in NFS WIKI tutorial, describes a particular case of export/data and home directories -
This example quite confused me and as far as I am concerned it is not the right idea,
at least to someone like me who try to establish NFS for the first time - This is only my opinion...
My simple goal is to share home directories, see and transfer files between each Linux machines connected to LAN.
At the moment, I can mount, as a client, to home directory on the server -
Since I need this mounting will be done during booting, I add this line to /etc/fstab:
Code:
10.0.0.6:/home/mg    /home/mg     nfs   rw,users  0 0

When the server is connected, this mounting is ok and the sharing is enabled - However if the server is not connected or turned off,
the booting of the client stuck during booting, in nfs mounting stage – How to change it so it will skip, in case of server not connected?
As you see I am using the ip address of the server - when I replaced it with the server's name, it did not mount - Any idea why?
If you have any tips on the above fstab mounting line - regarding security or any other issue.. - You will be welcomed :)
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Mon May 26, 2014 11:53 am    Post subject: Reply with quote

pmam wrote:
When the server is connected, this mounting is ok and the sharing is enabled - However if the server is not connected or turned off, the booting of the client stuck during booting, in nfs mounting stage – How to change it so it will skip, in case of server not connected?

pmam ... you might use autofs, the kernel automounter. This will allow you to set a '--timeout='.

pmam wrote:
As you see I am using the ip address of the server - when I replaced it with the server's name, it did not mount - Any idea why?

Because the hostname probably isn't resolvable via DNS.

best ... khay
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Mon May 26, 2014 12:20 pm    Post subject: Reply with quote

Dear Khay,

It really seems that AutoFS is what I need - I am going to figure out how to impliment...
If I use it - Does it mean that I do not need the additional mounting nfs line in fstab?

Quote:
Because the hostname probably isn't resolvable via DNS.

How can I work it out?

Thanks
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum