Fedora Linux Support Community & Resources Center
  #1  
Old 13th October 2006, 02:44 PM
neptune Offline
Registered User
 
Join Date: Aug 2006
Posts: 66
Angry samba instructions

I followed the instructions to the letter until I got to "cd to /etc/samba"


After that it just kept on saying command error, each set of instructions I look at or advised on are all different, what is one ment to do, every set of instructions is different to every web site one goes to or advised on.



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=/etc/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/
Reply With Quote
Reply

Tags
instructions, samba

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I always use these instructions anglicus Installation and Live Media 0 5th September 2009 09:43 PM
yum fc5 faq instructions broken? rclark Using Fedora 1 13th February 2007 05:25 AM
Instructions for using yum? Papoon Using Fedora 3 24th May 2005 04:31 AM


Current GMT-time: 20:01 (Thursday, 23-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat