Contents

Previous Next

Sharing Files by Connecting to a Windows System from a Linux System
To share files on a Windows system with a Linux system (by connecting to a Windows host from a Linux guest or connecting to a Windows guest from a Linux host or guest), you can mark a folder as shared on the Windows system, then use the smbmount utility in the Linux system to mount the shared folder. For example, if you want to share the folder C:\docs on a Windows 2000 system called win2k with a Linux system at /mnt/docs, follow the steps below. You may want to set up a shell script to run these commands.
1. Set up the folder or folders to share on the Windows system.
2. Create a user account on the Windows system for the Linux system user name that you are using to connect to the Windows system.
Otherwise, if you know the user name and password for a user account that can access the Windows system, you can specify that account on the command line.
3. From your Linux system, log in as root.
su -
4. Add the Windows system's host name and IP address to the hosts file, if the system cannot be found by name.
5. Mount the Windows share on your Linux system. Enter the following command all on one line.
mount -t smbfs -o username=<Windows system user account>,password=<password> //win2k/docs /mnt/docs
(Substitute the appropriate host name, share and mount point for your systems.)
Note: If you do not want to expose this password on the command line or in a script, leave out that option and provide the password when prompted after you run the command.
Now you are connected to the shared folder on the Windows system from your Linux system and can begin to share files between the two.


Previous Next