Link to home
Start Free TrialLog in
Avatar of thunderchicken
thunderchicken

asked on

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.

Thanks
Avatar of linuxwrangler
linuxwrangler

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.
Avatar of thunderchicken

ASKER

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
smbstatus
it should tell you version number of current samba server + other bits.

If samba is running check
/etc/smb.conf
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.
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
(and/or)
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?
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".
Adjusted points from 100 to 125
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 192.168.0.2 and the windows as 192.168.0.1, 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.

thanks!
ASKER CERTIFIED SOLUTION
Avatar of aramo
aramo

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
http://www.linux-mandrake.com/userguide/en/reference/016.html#139

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
thanks aramo, i'll take a look at it tonight and let you know.
http://ctdp.homestead.com/files/linux/usersguide/index.html

This web site has a lot of information about Linux, including a section on samba.
Comment accepted as answer
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 :)