Solved

Windows to LINUX question

Posted on 2000-05-11
21
274 Views
Last Modified: 2010-05-18
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
0
Comment
Question by:thunderchicken
  • 8
  • 5
  • 4
  • +3
21 Comments
 
LVL 2

Expert Comment

by:linuxwrangler
ID: 2802788
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.
0
 
LVL 2

Expert Comment

by:mzehner
ID: 2802802
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.
0
 
LVL 2

Expert Comment

by:mzehner
ID: 2802806
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.
0
 
LVL 11

Author Comment

by:thunderchicken
ID: 2802814
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?
0
 

Expert Comment

by:aramo
ID: 2803187
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.
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2807244
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.
0
 
LVL 11

Author Comment

by:thunderchicken
ID: 2807298
do i need to be logged on as root to access simba?
0
 
LVL 40

Expert Comment

by:jlevie
ID: 2807381
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.
0
 
LVL 2

Expert Comment

by:mzehner
ID: 2807597
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.
0
 

Expert Comment

by:AGB
ID: 2817853
Why you do not use ftp?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 11

Author Comment

by:thunderchicken
ID: 2817955
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)
0
 
LVL 2

Expert Comment

by:mzehner
ID: 2819527
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".
0
 
LVL 11

Author Comment

by:thunderchicken
ID: 2883368
Adjusted points from 100 to 125
0
 
LVL 11

Author Comment

by:thunderchicken
ID: 2883369
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!
0
 

Accepted Solution

by:
aramo earned 125 total points
ID: 2884066
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
127.0.0.1      localhost
192.168.0.2  torvalds
192.168.0.1  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 = 192.168.0.1 127.0.0.1

[homes]
comment = Home Directories
browseable = no
read only = no

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

6> Create the encrypted samba passwords file
#cd /etc
#cat /etc/passwd | mksmbpasswd.sh > /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]


 
0
 

Expert Comment

by:aramo
ID: 2884180
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
0
 
LVL 11

Author Comment

by:thunderchicken
ID: 2893113
thanks aramo, i'll take a look at it tonight and let you know.
0
 
LVL 2

Expert Comment

by:mzehner
ID: 2909280
http://ctdp.homestead.com/files/linux/usersguide/index.html

This web site has a lot of information about Linux, including a section on samba.
0
 
LVL 11

Author Comment

by:thunderchicken
ID: 2925208
Comment accepted as answer
0
 
LVL 11

Author Comment

by:thunderchicken
ID: 2925209
Thank You, Thank You!

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

0
 

Expert Comment

by:aramo
ID: 2929941
Your very welcome :)
0

Featured Post

Control application downtime with dependency maps

Visualize the interdependencies between application components better with Applications Manager's automated application discovery and dependency mapping feature. Resolve performance issues faster by quickly isolating problematic components.

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now