Windows to LINUX question

Hi experts,

I just installed another PC which is running Mandrake LINUX and I want to map a network drive to the LINUX box so I can open and save files on the LINUX box.  I have no clue how to do this, and what i am doing is programming a 400k c program in Microsoft's VC++, but I want to be able to save it as a Network Drive on LINUX.

LVL 11
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You need to use Samba. Check the Samba how-tos and man pages to get started - Mandrakes config tools probably can get you most of the way set up.

Samba will allow you to make Linux appear to be a Windows machine to your other Windows machines.

I set up a 250GB Samba file server where I used to work and the M$ diehards didn't figure it out for over a month except it seemed odd that it didn't crash. :) It was supposed to be a "quick fix" but it's still in service a year later.
I'm assuming that the network drive you need to map to the Linux box is on a windows machine.  If so, what windows is it?  If it is windows you will want to activate Samba services on your Linux machine.  I'm not sure what configuration tools you have in Mandrake, but in Redhat you would set up the /etc/smb.conf file, then activate the Samba services by activating the smb and nmb daemons.  This is done easily using the linuxconf tool in Redhat, selecting "control panel", then "control service activity", then setting the appropriate boxes to activate it.  I'm not sure how it is done in Mandrake.  You should have a sample samba (cmb.conf) file somewhere on your system.  Also there is a smb.conf man page and there should be other man pages that will help.  I believe it is smb or samba or both.
You'll also want to read the man pages on smbmount in order to actually do the mount.  Also check out the smbclient man page.
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

thunderchickenAuthor Commented:
This is actually what happened...

I had my old computer that I ran Windows 95 on, we blew it up and installed Mandrake, actually my friend did it.  We went out and bought two NIC cards and put them in there, he did the configuration on it, and I loaded win2k on my windows machine, windows2k sucked for my needs so windows 98 is back on it, but mandrake is still on the other machine.

Okay, here's the thunderchicken is a linux idiot.  I don't have anything hooked into the LINUX box other than the power cord and the network cord.  how do I go about doing all this SIMBA stuff?  Should I just wait until my buddy comes over to do it for me?
Setting up SAMBA is a doddle as anyone using Linux for more than 3 years will tell you :) Samba may well be setup already in which case you just need to check the network name its using and that username-passwords work OK.

On linux box type
it should tell you version number of current samba server + other bits.

If samba is running check
near the top of this file is the name of the workgroup that smaba thinks it belongs to, make this is same on your win9x PC. For an easy life use the same username/password on win9x and linux, ie you should be able to log on to Linux box with username/password that you use to logon to win9x.

If you still cannot see linuxPC in win9x network neighbourhood and you friend is calling over weekend, let him do the rest <my 2c>. If you interested in using linux and I hope you are then come back with details of how far you got and what problems your having.
As aramo correctly pointed out, setting up Samba is typically quite easy. Depending on how the installation was done, it may or may not be installed. If it's not, you can easily install it from the distribution CD with either a GUI (kpackage or gnorpm) or with the command line rpm utility.

Oh yea, when you configure Samba, you'll also want to enable "encrypted passwords" and create an SMB encrypted password with "smbpasswd -a use password", where "user" is your Linux username and "password" is the login password on the Win98 box.
thunderchickenAuthor Commented:
do i need to be logged on as root to access simba?
You'll need to be root to be able to configure Samba or to enable it. An ordinary user can run the smbstatus command. If you get a "command not found" then Samba probably isn't installed.
You can enter the command "ps -ax | grep samba" to see if it is running.  Also check to see if the file /etc/rc.d/init.d/smb exists.  If it does, you can type "/etc/rc.d/init.d/smb status" to see its status.  Also if you want to stop, start, or restart it, substitute stop, start, or restart respectively in the above command.
You'll probably need to use either the vi or the emacs editor to edit a few files with.  I use emacs, ant enter CTRL-x,CTRL-C to exit, then when it asks, I save the file.  If you need help here post a comment.
Before you run samba, you'll need to do the following:
1.  Be sure you can ping your linux box and your network is working.  You may want to be sure you can telnet to it.  Please post a comment if you have trouble here.
2.Be sure the following lines exist in your /etc/services file.
netbios-ns      137/tcp      # NETBIOS Name Service
netbios-ns      137/udp
netbios-dgm      138/tcp      # NETBIOS Datagram Service
netbios-dgm      138/udp
netbios-ssn      139/tcp      # NETBIOS session service
netbios-ssn      139/udp
3. Check your /ets/inetd.conf file and be sure lines like below (if they exist) ares commented out (# in front):
#netbios-ssn stream tcp nowait root /usr/sbin/tcpt /usr/sbin/smbd
#netbios-ns dgram udp wait root /usr/sbin/tcpd /usr/sbin/nmbd
4. Configure the /etc/smb.conf file.
5. You may want to make a /etc/smbusers file to map your machine/Windows login name to your Linux user names:
root = windoze1 windoze2
mark = windoze3
Some versions of windows send your windows login name, and I think others send your machine name.  You'll need to be aware of which name is being sent.  If you have trouble check your /var/log/messages and files in /var/log/samba.
6.  Set up your users with samba passwords with commands like the following:
smbpasswd -a
smbpasswd -a username

All this assumes you're logged in as root.  The /etc/samba file will take the most time.
To start you'll want the hosts deny line commented out (with a # or ;), you'll want "encrypt passwords = yes".  You should be able to a sample smb.conf file on your computer somewhere with comments.  If you look in the directory /usr/doc there may be a directory with a variant of the name samba.  Look in the directories there.  Also type whereis smb.conf, and see if it finds the file.  Post a comment and let us know if you have found a configuration file.  You don't want to type the whole thiong by hand.  If you don't have one, I'll be willing to post one, but it is long, and you'll need to be able to use ftp to get it to your Linux computer, unless you're browsing the web using your Linux computer.
Why you do not use ftp?
thunderchickenAuthor Commented:
ftp is an extra step, plus it logs you out after a few minutes.  i am currently using ftp and I want to see if I can do this.

(been busy at work, and haven't tried the above steps yet)
In step 3 the file should be /etc/inetd.conf.  At the end I meant to say "the /etc/smb.conf file will take the most time".
thunderchickenAuthor Commented:
Adjusted points from 100 to 125
thunderchickenAuthor Commented:
i do have samba installed, not running, but i am still confused as far as the LINUX side goes.  i can telnet and ftp directly to the LINUX box and I am using windows 98.  i have it set up as and the windows as, and I use a dial-up connection so the IP wont conflict.  what exactly is needed to do?  i am very much a beginner in this LINUX stuff so you can talk to me like i'm a 4th grader.  i'll increase the points depending on the help i get.

OK thunderchicken, I don't know how old a 4th grader is but I'll give this a shot. All commands run as root - signified by starting line with # symbol [time honoured tradition]. I use vi to edit files you may prefer pico or something else.

Local 'workgroup' will be called linuxnet

I'm going to call Linux box torvalds and win box grates - u substitute your preferred names below

1> Check Samba is installed - done

2> Check if samba is running
#/etc/rc.d/init.d/smb status

3> If samba running stop it while changing configuration
#/etc/rc.d/init.d/smb stop

Linux is doing dialup so dns is involved somewhere but (I assume) not setup  for local use

4> Edit /etc/lmhosts file to reflect local network at a minimum it will contain the lines      localhost  torvalds  grates

5> Edit /etc/smb.conf for your setup this files contains all samba options the defaults are pretty good but check the following lines in the file

workgroup = linuxnet
encrypt passwords = yes
security = user
domain master = yes
local master = yes
preferred master = yes
os level = 65
name resolve order = lmhosts hosts bcast
hosts deny = ALL
hosts allow =

comment = Home Directories
browseable = no
read only = no

comment = Temp file space
path = /tmp
read only = no

6> Create the encrypted samba passwords file
#cd /etc
#cat /etc/passwd | > /etc/smbpasswd

7> Edit /etc/smbpasswd to remove non-samba users eg mail uucp

8> Add samba passwords for real users, people who have accounts on torvalds and use grates - lets say bill is such a user

#smbpasswd -a bill                follow instructions, repeat for other users

9> Tidy up
#chmod 600 /etc/smbpasswd
#testparm                             checks smb.conf file makes sense

10> Start samba on torvalds

#/etc/rc.d/init.d/smb start

11> Log into grates as bill and check in control panel | network that win9x is on workgroup linuxnet and optionally domain linuxnet

12> Log out of grates reboot (well its traditional on win PCs) and log in again - look in network neighbourhood - you should see torvalds and be able to connect to it

13> IF you want to play with /etc/smb.conf do so and run
#/etc/rc.d/init.d/smb restart
when you have made changes

I've side stepped PAM issues, wins and fancy smb.conf sharing not to mention configuring Mandrake auto starting of scripts (probably OK) but even 4 graders get some home work, right ?

There is a neat way to configure samba using any browser - read up on swat utility if your interested.

Above works for Redhat - to my knowledge this is identical to Mandrake [currently downloading Mandrake over 56K .. so days to go yet before I'll know for sure]


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial

just stumbled across it but it has it all, I did notice that user home directories are setup in smb.conf as

 path = /export/homes/%U

ala SunOS
thunderchickenAuthor Commented:
thanks aramo, i'll take a look at it tonight and let you know.

This web site has a lot of information about Linux, including a section on samba.
thunderchickenAuthor Commented:
Comment accepted as answer
thunderchickenAuthor Commented:
Thank You, Thank You!

(there were lines in the /etc/smb.conf that I had to "uncomment" for anyone purchasing this PAQ)

Your very welcome :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux Networking

From novice to tech pro — start learning today.