Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Sharing portage directory via samba
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
padukes
Apprentice
Apprentice


Joined: 27 Feb 2003
Posts: 232

PostPosted: Fri Jul 11, 2003 4:14 pm    Post subject: Sharing portage directory via samba Reply with quote

Hi,

I'm trying to share my portage directory via samba so that I only have to "emerge sync" one machine on my network and then all machines can read from it for ebuilds and they can also write to it when they download distfiles. I assume this makes sense and is somewhat typical.

I've created the share on the main machine with this in my smb.conf:
Code:
[portage]
   comment = Portage Files
   path = /usr/portage
   writable = yes
   valid users = root


However, when I try to connect I get this error (I'm sure the password is correct):
Code:
localhost root # smbmount //192.168.0.1/portage /mnt/portage/ -o username=root
Password:
27578: session setup failed: ERRSRV - ERRbadpw (Bad password - name/password pair in a Tree Connect or Session Setup are invalid.)
SMB connection failed


My questions are:
1. Does this setup make sense? If not how would you change it?
2. Can you help me with this error?

Thanks,
P

p.s. Are there any major benefits to using NFS instead of Samba? I would prefer to use Samba because I need it anyway and would rather not install more services - but I'm flexible if it makes sense
Back to top
View user's profile Send private message
padukes
Apprentice
Apprentice


Joined: 27 Feb 2003
Posts: 232

PostPosted: Fri Jul 11, 2003 4:21 pm    Post subject: Reply with quote

If it's any help I found this in the log:

Code:
[2003/07/11 12:16:44, 0] passdb/pdb_smbpasswd.c:pdb_getsampwnam(1369)
  unable to open passdb database.
[2003/07/11 12:16:44, 0] passdb/pampass.c:smb_pam_passcheck(827)
  smb_pam_passcheck: PAM: smb_pam_auth failed - Rejecting User root !


Thanks,
P
Back to top
View user's profile Send private message
hayu
n00b
n00b


Joined: 25 May 2003
Posts: 5

PostPosted: Fri Jul 11, 2003 4:33 pm    Post subject: Reply with quote

Not sure if you did the following.

Code:
smbpasswd -a root
Back to top
View user's profile Send private message
padukes
Apprentice
Apprentice


Joined: 27 Feb 2003
Posts: 232

PostPosted: Fri Jul 11, 2003 4:42 pm    Post subject: Reply with quote

Awesome! Thanks - that worked. However, I get this error:

Code:
MyName samba # smbpasswd -a root
New SMB password:
Retype new SMB password:
unable to open passdb database.
Added user root.


So here are my new questions:
1. Can you help me with the passdb database issue?
2. Is there anyway to have samba:
2a. Use my machine password instead of having to specify a new one
2b. Automatically pull in all of the users that have been created on my machine?

Thanks so much,
P
Back to top
View user's profile Send private message
trjones4
n00b
n00b


Joined: 27 Feb 2003
Posts: 28
Location: Somerville, MA

PostPosted: Fri Jul 11, 2003 5:12 pm    Post subject: Reply with quote

I've recently finished setting up a mixed Gentoo and Windoze network. We use Samba as a domain controller and NFS to share filesystems between the Gentoo boxes. I believe using NFS between linux boxes improves the transfer speed over a Samba connection ... Of course, before any of this will work make sure you have NFS Client and Server support enabled in your kernel ...

NFS is pretty straightforward to configure. For example, if I want to share a directory on one machine with the other (hellfire) i first (on each machine) ...

Code:
emerge nfs-utils


And then I edited the /etc/exports file (on the serving machine, hercules) to read something like this ...

Code:
/home/share_name    hellfire(rw,all_squash,anonuid=1026,anongid=1001,sync)


Then ... (on each machine) execute:

Code:
$/etc/init.d/nfs start
$rc-update add nfs default


What this does is NFS export the directory /home/share_name to a machine named hellfire for read/write (rw) access and forces all file transfers to take place as userid = 1026 and groupid = 1001 (the all_squash option). The sync option is recommended for most "always on" applications. Of course, you should make sure the user you assign has the proper rights to the directory in question ... etc.

As with anything, be sure to check out the man pages on nfs for all the possible options (there are quite a few).

Then, on the client machine(s) you can execute ...

Code:
 mount -t nfs hercules:/home/share_name /home/local_mount


Of course you can then edit your /etc/fstab file to take of the mounts from then on ...

Anyway, just my thoughts on the matter :-) ... hope it helps. Have a good one ...
_________________
------------------------------------------
Troy B. Jones
troy (dot) b (dot) jones (at) gmail.com
Back to top
View user's profile Send private message
hayu
n00b
n00b


Joined: 25 May 2003
Posts: 5

PostPosted: Fri Jul 11, 2003 5:58 pm    Post subject: Reply with quote

padukes wrote:
Awesome! Thanks - that worked. However, I get this error:

Code:
MyName samba # smbpasswd -a root
New SMB password:
Retype new SMB password:
unable to open passdb database.
Added user root.


So here are my new questions:
1. Can you help me with the passdb database issue?
2. Is there anyway to have samba:
2a. Use my machine password instead of having to specify a new one
2b. Automatically pull in all of the users that have been created on my machine?

Thanks so much,
P


There's a normal error when you don't have the password db. You should be able to login as root now.

Take a look at http://us3.samba.org/samba/devel/docs/html/pam.html

It show you how to synchronize password.
Back to top
View user's profile Send private message
padukes
Apprentice
Apprentice


Joined: 27 Feb 2003
Posts: 232

PostPosted: Fri Jul 11, 2003 6:36 pm    Post subject: Reply with quote

Thanks!
Back to top
View user's profile Send private message
padukes
Apprentice
Apprentice


Joined: 27 Feb 2003
Posts: 232

PostPosted: Mon Jul 14, 2003 6:11 pm    Post subject: Reply with quote

Hey - so I've been having weird errors with portage since I've been sharing it over samba, and so I am going to try to NFS. I was wondering what are the appropriate permissions to set on the /usr/portage directory (and files) as well for the NFS share.

trjones4's suggestions appear to be specific users on his machine - I was expecting that it'd have to be root or portage or something.

Thanks,
P
Back to top
View user's profile Send private message
trjones4
n00b
n00b


Joined: 27 Feb 2003
Posts: 28
Location: Somerville, MA

PostPosted: Mon Jul 14, 2003 8:07 pm    Post subject: NFS sharing of /usr/portage Reply with quote

I haven't tried sharing /usr/portage so I'm not much for specific help in that area :? .

But, you don't have to use the options like all_squash which I used in the example .. I'm using them currently so I just copied the file :-) Anyway, as long as the same userid and groupid exist on the sever and client (with synched passwords), then the share should function as expected for that user. For the case of /usr/portage, maybe you can just make sure the uid and gid for root are the same and then use the same password on each machine?
Good luck ..

Hey, eventually all this sharing /usr/portage stuff will be moot when we can all run OpenMosix kernels with LTSP :D
_________________
------------------------------------------
Troy B. Jones
troy (dot) b (dot) jones (at) gmail.com
Back to top
View user's profile Send private message
padukes
Apprentice
Apprentice


Joined: 27 Feb 2003
Posts: 232

PostPosted: Tue Jul 15, 2003 1:20 am    Post subject: Reply with quote

Hey,

So thanks for your help so far. I've installed nfs-utils on the server and the client. And started the service on both machine. But it seems like overkill to have another server running on the client (even though it's not exporting anything) - is there anyway to only run the client stuff on the client machine?

Also, I'm using the no_root_squash option so that the client has all root privileges (read/write/etc) on the server's directory - Can you think of any reason not to do this?

Thanks again.

P
Back to top
View user's profile Send private message
padukes
Apprentice
Apprentice


Joined: 27 Feb 2003
Posts: 232

PostPosted: Tue Jul 15, 2003 1:25 am    Post subject: Reply with quote

I'm re-posting this because it's gotten so far off topic ;-)
Back to top
View user's profile Send private message
trjones4
n00b
n00b


Joined: 27 Feb 2003
Posts: 28
Location: Somerville, MA

PostPosted: Tue Jul 15, 2003 4:40 pm    Post subject: Reply with quote

As for NFS client and server running on each machine, you could disable client support in the server kernel config and disable server support in the client machine's kernel config. You might save some overhead that way, but really when I do a top as root my nfsd processes are all near the bottom (with most of the samba daemons above using more memory).

Code:

Tasks:  87 total,   1 running,  86 sleeping,   0 stopped,   0 zombie
top - 08:32:00 up 6 days,  3:52,  6 users,  load average: 0.00, 0.00, 0.00
Tasks:  87 total,   1 running,  86 sleeping,   0 stopped,   0 zombie
Cpu(s):   2.2% user,   0.4% system,   0.0% nice,  97.4% idle
Mem:    904404k total,   892888k used,    11516k free,   250648k buffers
Swap:   498004k total,     3124k used,   494880k free,   323956k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  Command
15911 root      18   0   916  916  720 R  3.8  0.1   0:00.04 top
    1 root       9   0   344  316  288 S  0.0  0.0   0:03.45 init
    2 root       9   0     0    0    0 S  0.0  0.0   0:06.14 keventd
    3 root      19  19     0    0    0 S  0.0  0.0   0:00.91 ksoftirqd_CPU0
    4 root      19  19     0    0    0 S  0.0  0.0   0:00.96 ksoftirqd_CPU1
    5 root       9   0     0    0    0 S  0.0  0.0   1:40.03 kswapd
    6 root       9   0     0    0    0 S  0.0  0.0   0:01.90 bdflush
    7 root       9   0     0    0    0 S  0.0  0.0   0:03.12 kupdated
    8 root       9   0     0    0    0 S  0.0  0.0   0:00.02 aacraid
    9 root       9   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_0
   10 root       9   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_1
   11 root       9   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_2
   12 root       9   0     0    0    0 S  0.0  0.0   0:06.56 kjournald
  149 root       9   0   888  800  556 S  0.0  0.1   0:00.16 devfsd
  210 root      11   0     0    0    0 S  0.0  0.0   0:07.70 kjournald
  774 root       8   0  1380  868  784 S  0.0  0.1   0:00.09 smbd
  776 root       9   0  1312  920  736 S  0.0  0.1   0:27.49 nmbd
  801 root       9   0   596  528  472 S  0.0  0.1   0:01.72 syslogd
  803 root       9   0   524  368  368 S  0.0  0.0   0:00.03 klogd
  819 root       9   0   468  408  408 S  0.0  0.0   0:00.01 agetty
 1001 root       9   0  3076 2592 1760 S  0.0  0.3   0:37.93 smbd
 1028 root       9   0     0    0    0 S  0.0  0.0   0:06.87 rpciod
 3751 bin        9   0   452  348  348 S  0.0  0.0   0:00.02 portmap
 3759 root       9   0   112   32    0 S  0.0  0.0   0:00.01 rpc.statd
 3776 root       9   0     0    0    0 S  0.0  0.0   0:00.00 lockd
 8757 root       9   0  1192 1012  964 S  0.0  0.1   0:03.63 sshd
21067 root       9   0     0    0    0 S  0.0  0.0   0:00.00 kjournald
 4020 root       8   0   844  596  596 S  0.0  0.1   0:00.01 xinetd
 4039 root       9   0  3720 3336 2004 S  0.0  0.4   1:36.46 smbd
 4314 root       9   0   792  656  604 S  0.0  0.1   0:00.00 ssh-agent
 4954 root       9   0     0    0    0 S  0.0  0.0   0:00.00 knodemgrd_0
 4957 root       9   0     0    0    0 S  0.0  0.0   0:00.00 scsi_eh_3
 5447 root       9   0     0    0    0 S  0.0  0.0   0:39.25 kjournald
 6164 root       9   0  2760 2368 1928 S  0.0  0.3   0:21.64 smbd
 6168 root       9   0  3284 2940 1960 S  0.0  0.3   0:16.92 smbd
18098 root       9   0  1252 1252 1008 S  0.0  0.1   0:00.07 login
18144 root       9   0     0    0    0 S  0.0  0.0   0:01.57 nfsd
18145 root       9   0     0    0    0 S  0.0  0.0   0:02.53 nfsd
18146 root       9   0     0    0    0 S  0.0  0.0   0:00.02 nfsd
18147 root       9   0     0    0    0 S  0.0  0.0   0:00.00 nfsd
18148 root       9   0     0    0    0 S  0.0  0.0   0:00.01 nfsd
18149 root       9   0     0    0    0 S  0.0  0.0   0:01.19 nfsd
18150 root       9   0     0    0    0 S  0.0  0.0   0:00.00 nfsd
18151 root       9   0     0    0    0 S  0.0  0.0   0:00.02 nfsd
18155 root       9   0   620  544  496 S  0.0  0.1   0:00.00 rpc.mountd
 5304 cfd       15   0  3172 2828 1952 S  0.0  0.3   0:13.70 smbd
 5305 root       9   0  2648 2248 2040 S  0.0  0.2   0:07.52 smbd
root@hercules temp #


Anyway, I've found that having client & server on each machine is handy ... I've ended up cross exporting file systems from each machine. After this discussion I might try exporting /usr/portage as well :D

Also, I don't see a problem with using the no_root_squash option on /usr/portage. Makes sense to me, but of course I'm still a n00b at this stuff :-)

Have a good one ...
_________________
------------------------------------------
Troy B. Jones
troy (dot) b (dot) jones (at) gmail.com
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
Page 1 of 1

 
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