<---- template headericclude ----->
Samba Tutorial (FC2)
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 13 of 13
  1. #1
    rendered_one Guest

    Lightbulb Samba Tutorial (FC2)

    This is a tutorial for using SAMBA to connect to your Win9x/2000/XP (and whatever other vers of windows there are) shares. You will need root access.

    First open up a terminal (as reg. user) and type:
    "smbclient -v"
    smbclient should print some version information.
    If it does, great, if not, make sure you have samba installed!!!

    First of all to display the machine's shares you need to know the machines name. In my case it is "serv1". To view the machines shares type this in:
    "smbclient -U userid -L machine "
    Where you replace 'userid' and 'machine' with your NETWORK username and the name of the machine you are trying to connect to. In my case this is tim and serv1.

    It will prompt you for a password, type it in. After that it should list all the machines shares.

    Now type this in:
    "su -"
    This should promt you for the root password, type it in.

    cd to /etc/samba

    Now create a file called "auth.smb" (it doesn't have to be this, i've done it for clarity). Using your favorite text editor put the following lines in the file:
    "username = netuserid
    password = netpass "
    Replacing netuserid and netpass with your username and password respectivley.

    If your unsure how to do this, type:
    "vi auth.smb"
    At the command prompt. When it appears, press the Insert key on your keyboard and type in the above (MAKE SURE YOU PUT THEM ON TWO SEPERATE LINES). When your finished press the Esc key on your keyboard, type press : (thats the colon key), and then type "wq" and enter.

    Next you need to make sure that no-one else can access the file by typing:
    "chmod 600 auth.smb"
    This changes the file permissions to "-rw-------", meaning that only root can read or write to the file.

    Before you mount your share, you will need to create a dir for it. Type:
    "mkdir /mnt/sharename "
    At the command prompt. Where sharename is the name of your share (for clarity only, you can name it whatever you want).

    Now type this at the command prompt:
    "smbmount //machine/share /mnt/sharename -o "credentials=/etc/samba/auth.smb,uid=userid,gid=userid,fmask=664,dmask=775"
    Where machine, share, sharename, and userid are replaced with their respected values. In my case where I am connecting to win98 on serv1 using my windows username tim and mounting it to /mnt/win98, I would type:
    "smbmount //serv1/win98 /mnt/win98 -o "credentials=/etc/samba/auth.smb,uid=tim,gid=tim,fmask=664,dmask775"

    If all you wanted to know is how to mount a share you can stop now. If you're looking to make samba automatically mount the shares on boot or want to simplify the mounting process for next time, then keep reading

    Do all of this as root:
    1. "vi /etc/fstab"
    2. Press the Insert key
    4. Goto the end of the file
    5. Enter this line at the end of fstab:
    "//machine/share /mnt/sharename smbfs nosuid,nodev,noexec,credentials=/mnt/samba/auth.smb,uid=username,gid=username,fmask=664,dmask=755 0 0"
    6. Press the Esc key
    7. Press the colon key
    8. Type wq then press enter

    Replace 'machine', 'share', 'sharename', 'username', and whatever else you customized (the dir to auth.smb for example) to what your settings reflect. For me it would look like this:
    "//serv1/win98 /mnt/win98 smbfs nosuid,nodev,noexec,credentials=/mnt/samba/auth.smb,uid=tim,gid=tim,fmask=664,dmask=755 0 0"
    If you don't want to mount automatically but want to be able to mount (as any user) easily put "users,noauto," in front of nosuid and you will be able to mount by typing "mount /mnt/win98" at the command prompt.

    If you can't wait until next boot (for auto mounts) do this:
    "cd /etc/rc.d/init.d"
    "./netfs start"
    A script will run and mount your samba share(s), and if your in Gnome will put icons on your desktop for you.

    Enjoy!

    If you have any questions just send a reply to this post and I'll answer back asap.

    P.S. Some good resources are the samba man pages and documentation at http://www.samba.org/

  2. #2
    dogface Guest
    Holy cow, Im glad I dont have to do all that. I just click on Networks, then click on my windows workgroup and go to whatever I need...am using Fedora 2 with basic install on desktop.
    Last edited by dogface; 26th July 2004 at 02:06 PM. Reason: add a word

  3. #3
    superbnerd Guest
    dogface, you can browse you smb network from gnome. wow, I thought there was a bug preventing it.

  4. #4
    zipper Guest
    What do I need to do on my W98 machine? I followed the first few instructions in this tutorial and just got the message that connection failed.

    zipper

  5. #5
    superbnerd Guest
    w98 in fedoraforum interesting... you need to enable filesharing in the setwork settings inthe control panel. an d it will probably ask you to insert the w898 cd. all you realy need to set is the work group name, and make sure that password encryption is disabled in samba because w98 does not support it, which is tragic becasue that means you network will become vulnerable to a script kiddie becuase you are using a decrepit gui of dos. Best of luck.

  6. #6
    greenleaf Guest

    Wink I found out the answer!

    That's the strange thing I discovered after digging around the posts here. Some users' Fedora are OK some like you & me are in troulble. I have FC2, and so did you?


    http://www.fedoraforum.org/forum/sho...02&postcount=2

    I have solved my own problems with samba mounts, to share it with all who need this info here, I drop the URL of the thread above.

    Special thanks to great guy rendered_one who posted this totorial above, it was from there I had info to make expriments to discover what was the problem I faced.

    It is the damn umask.

    Last edited by greenleaf; 5th September 2004 at 01:56 PM. Reason: Discovered a solution

  7. #7
    Join Date
    Jun 2004
    Posts
    715
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So what is the best way to share folders or drives between (2) Linux machines running say...Fedora and Suse?

  8. #8
    speedyb Guest

    Question

    perhaps you can help me.

    I have had some trouble mounting My Windows-2003 shares.

    But now I found the following issue.

    I created a domainuser linux.
    on my shares the user linux has read-permissions only. On the directory (on the harddrive in windows) also. So no conflicting rights here.

    When I mount my share with the command
    mount -t smbfs -o username=linux,workgroup=brewery,rw //heineken/Programs /data/Programs

    I still have write permissions. When I remove the rw only root has write permissions to create new files / directorys and others have only rights to change files. I mean the content. Is there a way to chage this?

    I am really puzzled at the moment.

    Below you see the directory listing which resides on my Windows-2003 server.
    Code:
    drwxr-xr-x  1 root root 4096 Sep 22 13:12 .
    drwxrwxr-x  7 root root 4096 Aug 25 09:19 ..
    drwxr-xr-x  1 root root 4096 Jul 25 12:10 drivers
    drwxr-xr-x  1 root root 4096 Jul 25 11:55 games
    drwxr-xr-x  1 root root 4096 Jul 25 11:15 images
    drwxr-xr-x  1 root root 4096 Sep  3 11:05 linuxInstalls
    drwxr-xr-x  1 root root 4096 Sep 15 09:05 movies
    drwxr-xr-x  1 root root 4096 Jul 25 11:00 PocketPC
    -rwxr-xr-x  1 root root  478 Sep 22 13:13 .readme.txt
    drwxr-xr-x  1 root root 4096 Sep 16 20:58 winPrograms

    BTW I am running Fedora Core 2 with all latest updates. Also on windows-2003 all latest updates. My windows-2003 server is an Domain Controller.
    Last edited by speedyb; 22nd September 2004 at 12:58 PM.

  9. #9
    speedyb Guest

    Question

    I saw an hint somewhere in samba groups stating that the option ro was needed for this. But this didn't do the trick.

  10. #10
    rendered_one Guest
    I'm not quite sure i get what u mean.. are you having problems with mounting... or permissions???

  11. #11
    speedyb Guest
    Quote Originally Posted by rendered_one
    I'm not quite sure i get what u mean.. are you having problems with mounting... or permissions???
    I have a problem with permissions.
    I don't seem to be able to mount a share read only. I mean for everyone.

    everyone can always edit the files as it seems. not create new ones. only root can do that. but still anyone can edit them

  12. #12
    vinci Guest
    Quote Originally Posted by rendered_one
    This is a tutorial for using SAMBA to connect to your Win9x/2000/XP (and whatever other vers of windows there are) shares. You will need root access.

    First open up a terminal (as reg. user) and type:
    "smbclient -v"
    smbclient should print some version information.
    Version information is this: "smbclient -V" , there is not '-v' - this gives only usage information because smbclient does not know this option.
    Last edited by vinci; 25th September 2004 at 01:25 PM. Reason: something wrong

  13. #13
    speedyb Guest
    Quote Originally Posted by speedyb
    I have a problem with permissions.
    I don't seem to be able to mount a share read only. I mean for everyone.

    everyone can always edit the files as it seems. not create new ones. only root can do that. but still anyone can edit them

    I solved it.

    It was a problem on my windows system That I could write there. I fixed that part. but still I find it strange that when you mount a drive read-only that root can still write files and that user still can modify files.

Similar Threads

  1. VNC Tutorial
    By WJProctor in forum Servers & Networking
    Replies: 3
    Last Post: 4th January 2007, 11:27 PM
  2. tutorial
    By timelord in forum Installation, Upgrades and Live Media
    Replies: 4
    Last Post: 12th May 2006, 09:48 PM
  3. Samba tutorial
    By Dridhas in forum Using Fedora
    Replies: 4
    Last Post: 13th September 2005, 11:44 PM
  4. Samba Tutorial (FC2)
    By rendered_one in forum Guides & Solutions (Not For Questions)
    Replies: 41
    Last Post: 12th October 2004, 01:21 PM
  5. NFS Tutorial??
    By orbknives in forum Using Fedora
    Replies: 2
    Last Post: 3rd September 2004, 07:08 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[[template footer(Guest)]]