this will get long but this is a samba howto i got from a mate, ill try again, maby itll work maby not =)
COLLEGELINUX WINDOWS/LINUX FILE SHARING
This HOWTO is for people who want to be able to share files between Linux and Windows computers. This HOWTO tells one how to configure samba to do this from the command line with College.
There are two ways of looking at file sharing between the two systems. Both of which will be explained in this HOWTO.
Access to files on a Windows based system from Linux.
Access to files on a Linux based system from Windows.
ACCESS TO FILES ON A WINDOWS BASED SYSTEM FROM LINUX
This is probably the easiest to configure cross platform file sharing configuration. All that it requires is the correct access on the Windows machine and a few lines.
First of all it’s a good idea to have both machines running within the same workgroup for ease of use. By default both Windows and Samba’s workgroup are set to “WORKGROUP”. In the case of this being different on either machine we will need to change either machine so that they both run within the same workgroup.
----------- From Linux
We will first go to the samba configuration file.
cd /etc/samba
Then we will open the file called smb.conf
We will change the line which says
workgroup = WORKGROUP
To our desired workgroup, in this case FOOBAR so it will look like
workgroup = FOOBAR
----------- From Windows
Depending on which version of MS Windows you are running things will be slightly different, but what you need to do is tell your windows machine to join your new workgroup (in this case FOOBAR).
Usually it’s found under Start -> Settings -> Control Panel -> Network Settings
However this isn’t always the case so you could refer to your help files for additional information.
Now that we’re part of a workgroup we need to share the files on the Windows machine that we want.
In most cases to do this we would right click the directory -> properties -> sharing.
Set the permissions, give the share a name, apply and the directory will be shared.
Next we need to create a user on the Windows machine which will have access to the new share. In most cases this is done the following way.
Start -> Settings -> Control Panel -> Users and Passwords
Here we will add a new user with rights depending on what you want the user to be able to do. For this HOWO’s sake the user will be called “share” with the password being set to “share”.
Now that the Windows setting have been completed all that’s left to do is to mount the Windows drive from the Linux command line.
The first thing that we’ll need is a mount point. It’s usual for someone to mount to the /mnt directory for easy access. We will start by making a directory within the /mnt directory and call it “winshare”.
mkdir /mnt/winshare
To mount the drive we would issue the following command.
mount -t smbfs -o username=share,password=share //Onyx/share /mnt/winshare
username = specified username on Windows machine (i.e. user that was just created).
password = password for specified user.
Onyx = Windows Computer’s name.
share = the shared directory.
/mnt/winshare = the new mount point previously created.
And that’s about all there is to getting access to a Windows drive in Linux. There are several ways to automate the process, such as fstab, rc.local depending on preference. I tend to put my mount command in rc.local which resides in /etc/rc.d
But it depends on personal preference.
ACCESS TO FILES ON A LINUX BASED SYSTEM FROM WINDOWS
If the directions were followed to get the following only takes on line to get to work on the Linux side and then just the mapping of the drive on the Windows side.
Just a few things to note:
You will give a user on your system remote access to his/her /home directory
The user should already exist
I will not go into further directory access
Simply issue the following command with “user” being a valid user on your Linux box.
smbpasswd -a user
Enter a password, verify it, and it will be done.
To access the drive from Windows there’re two options.
One could map the drive for permanent access
One could browse to the drive every time access is required.
To browse to the drive open Internet Explorer/Windows Explorer and type
\\Onyx
Replacing Onyx with your Linux Box’s name. If you don’t know this just look at your command line it will say user@Onyx or whatever your computer name is. Enter the username of the user that you just created, enter the password -you have access to your home directory.
To get permanent access to the drive one would have to map the drive. This involves the following steps.
Right click My Computer and click Map Network Drive
Choose a drive letter and click browse
Go to My Network Places/Network Neighborhood and find the machine there.
Select the home directory of the created samba user
Enter username and password and you’ll have the drive mapped so that it is connected every time you start up your computer.
Please send all comments about how this could be improved or if something’s unclear to
kinus@capeflats.org.za