[svlug] mount, smbfs, ssh, and local console weirdness

David Christensen dpchrist at inreach.com
Sun Aug 4 23:49:23 PDT 2002


linux.samba & svlug at lists.svlug.org:

I have a LAN with Windows and Linux machines.  One Windows 2000 machine,
"W2K30G", has a directory "E:\share" which is shared as "\\W2K30G\SHARE"
with permissions "Everyone: Full Control Allow, Change Allow, and Read
Allow".  Other Windows machines and their users can see the folder and
read/ write/ create files without any problems.


I would like to allow similar access for Linux machines and users.  My
idea was to create matching user accounts "smbuser" on both machines,
create a mount point "/share" on the Linux machine, and mount the
Windows shared directory on the Linux machine via smbfs:

1.  Create account "smbuser" with password "smbuser" on "W2K30G".

2.  Configure Linux host "r7320g" as follows:

        root at r7320g:~# useradd -M smbuser

        root at r7320g:~# passwd smbuser

        root at r7320g:~# vi /etc/group

            Edit the line "smbuser" as follows:

            smbuser:x:504:dpchrist

        root at r7320g:~# mkdir /share

        root at r7320g:~# vi /etc/fstab

            Add a line as follows:

            \\w2k30g\share /share smbfs username=smbuser,password=smbus
er,uid=smbuser,gid=smbuser,dmask=2775 0 0

        root at r7320g:~# mount /share

        root at r7320g:~# ls -al /share
        total 52
        drwxrwxr-x    1 smbuser  smbuser      4096 Jun 11 22:19 .
        drwxr-xr-x   23 root     root         4096 Aug  1 12:11 ..
        drwxrwxr-x    1 smbuser  smbuser      4096 Jul 10 17:32 attached
        drwxrwxr-x    1 smbuser  smbuser      4096 May 21 22:38 backup
        drwxrwxr-x    1 smbuser  smbuser      4096 Jun 17 09:47 cddb
        drwxrwxr-x    1 smbuser  smbuser      4096 Jun 12 16:03 dist
        drwxrwxr-x    1 smbuser  smbuser      4096 May 21 22:32 download
        drwxrwxr-x    1 smbuser  smbuser      4096 Jul 29 12:46 games
        drwxrwxr-x    1 smbuser  smbuser      4096 May 21 22:38 music
        drwxrwxr-x    1 smbuser  smbuser      4096 Jul 22 10:24 os
        drwxrwxr-x    1 smbuser  smbuser      4096 May 22 15:37 released
        drwxrwxr-x    1 smbuser  smbuser      4096 May 31 12:13 sounds
        drwxrwxr-x    1 smbuser  smbuser      4096 Jul 17 12:15 support

Note that the group sticky bit is not set as I was expecting
("dmask=2775" option in "/etc/fstab") (ref. man smbmount).


When I ssh into r7320g from W2K30G (Cygwin), everything is well:

    dpchrist at W2K30G:~$ ssh 192.168.1.2

    dpchrist at r7320g:~$ touch /share/foo

    dpchrist at r7320g:~$ ll /share
    total 52
    drwxrwxr-x    1 smbuser  smbuser      4096 Jun 11 22:19 ./
    drwxr-xr-x   23 root     root         4096 Aug  1 12:11 ../
    drwxrwxr-x    1 smbuser  smbuser      4096 Jul 10 17:32 attached/
    drwxrwxr-x    1 smbuser  smbuser      4096 May 21 22:38 backup/
    drwxrwxr-x    1 smbuser  smbuser      4096 Jun 17 09:47 cddb/
    drwxrwxr-x    1 smbuser  smbuser      4096 Jun 12 16:03 dist/
    drwxrwxr-x    1 smbuser  smbuser      4096 May 21 22:32 download/
    -rwxr-xr-x    1 smbuser  smbuser         0 Aug  1 13:52 foo*
    drwxrwxr-x    1 smbuser  smbuser      4096 Jul 29 12:46 games/
    drwxrwxr-x    1 smbuser  smbuser      4096 May 21 22:38 music/
    drwxrwxr-x    1 smbuser  smbuser      4096 Jul 22 10:24 os/
    drwxrwxr-x    1 smbuser  smbuser      4096 May 22 15:37 released/
    drwxrwxr-x    1 smbuser  smbuser      4096 May 31 12:13 sounds/
    drwxrwxr-x    1 smbuser  smbuser      4096 Jul 17 12:15 support/

    dpchrist at r7320g:~$ rm /share/foo


>From the console of r7320g, I can see directories and read their files.
But, attempting to create a file:

    dpchrist at r7320g:~$ touch /share/foo
    touch: creating `/share/foo': Permission denied


Any suggestions?


TIA,

David








More information about the svlug mailing list