CSE2003S09.Samba History

Hide minor edits - Show changes to output

March 02, 2012, at 11:38 PM by 58.148.57.167 -
Changed line 79 from:
Then, you will be able to see the directory named @@shared@@ as shown in this figure.
to:
Then, you will be able to see the directory named @@share@@ as shown in this figure.
Changed line 85 from:
Now if you put something on the @@share@@ directory, it can be accessed in both Windows and Linux.
to:
Now if you put something on the @@share@@ directory, it can be accessed both in Windows and in Linux.
Changed lines 85-89 from:
Now if you put something on the @@share@@ directory, it can be accessed by both Windows and Linux.
to:
Now if you put something on the @@share@@ directory, it can be accessed in both Windows and Linux.


Changed line 54 from:
Click the icon of the @@share@@ directory, and press the right button of your mouse. Then, click @@Sharing Options@@. Check all the sharing options as show in the following figure, and then press @@Create Share@@ button. You will be asked if it is ok for the directory to have write permission by others. Just click @@Add the permissions automatically@@. (Note that this is not a safe way of sharing a directory as anybody can read or write the directory. For more secure sharing, you need to create a new user account in Linux whose id matches the one used in Windows.) Now your @@/home/user/share/@@ directory is ready to be shared with Windows.
to:
Click the icon of the @@share@@ directory, and press the right button of your mouse. Then, click @@Sharing Options@@. Check all the sharing options as shown in the following figure, and then press @@Create Share@@ button. You will be asked if it is ok for the directory to have write permission by others. Just click @@Add the permissions automatically@@. (Note that this is not a safe way of sharing a directory as anybody can read or write the directory. For more secure sharing, you need to create a new user account in Linux whose id matches the one used in Windows.) Now your @@/home/user/share/@@ directory is ready to be shared with Windows.
Changed lines 4-5 from:
!! Sharing files between Windows (host) and Linux (guest) using Samba
to:
!! Sharing files between Windows (host) and Linux (guest) using Samba\\
Added line 5:
Changed lines 79-81 from:
Then, you will be able to see the directory named @@shared@@ as follows.
to:
Then, you will be able to see the directory named @@shared@@ as shown in this figure.
Changed lines 85-103 from:


'''6. Using Windows-based ftp client'''.\\


If you are not familar with the command line version of the ftp client, you can use other Windows-based ftp client programs such as FileZilla
. The FileZilla program is a free ftp client available from http://filezilla-project.org. With FileZilla, you don't have to type @@get@@ or @@put@@ command by yourself. Just drag and drop whatever files you want.


The following figure shows how to setup your FileZilla to connect to your Linux machine. Remember you need to specify your own IP address obtained from step 4.


%center%http:/uploads/CSE2003S09/Filezilla_setup.gif"Setting up FileZilla"


Once connected, you can easily move files to and from the Linux machine. Enjoy!



%center%http:/uploads/CSE2003S09/Filezilla.gif"Using FileZilla"
to:
Now if you put something on the @@share@@ directory, it can be accessed by both Windows and Linux.


Added lines 76-83:



Then, you will be able to see the directory named @@shared@@ as follows.


%center%http:/uploads/CSE2003S09/Access_share2.gif"Accessing the share directory"
Changed line 54 from:
Click the icon of the @@share@@ directory, and press the right button of your mouse. Then, click @@Sharing Options@@. Check all the sharing options as show in the following figure, and then press @@Create Share@@ button. Now your @@/home/user/share/@@ directory is ready to be shared with Windows.
to:
Click the icon of the @@share@@ directory, and press the right button of your mouse. Then, click @@Sharing Options@@. Check all the sharing options as show in the following figure, and then press @@Create Share@@ button. You will be asked if it is ok for the directory to have write permission by others. Just click @@Add the permissions automatically@@. (Note that this is not a safe way of sharing a directory as anybody can read or write the directory. For more secure sharing, you need to create a new user account in Linux whose id matches the one used in Windows.) Now your @@/home/user/share/@@ directory is ready to be shared with Windows.
Changed lines 54-57 from:
Click the icon of the @@share@@ directory, and press the right button of your mouse. Then, click @@Sharing Options@@. Check all the sharing options as show in the following figure, and then press @@Create Share@@ button.
to:
Click the icon of the @@share@@ directory, and press the right button of your mouse. Then, click @@Sharing Options@@. Check all the sharing options as show in the following figure, and then press @@Create Share@@ button. Now your @@/home/user/share/@@ directory is ready to be shared with Windows.
Changed lines 62-76 from:

This @@ifconfig@@ command prints out all
the information related to network interfaces attached to your system. Normally, you will have at least two network interfaces; one (@@ethX@@) is the virtual Ethernet interface created by the VMware Player, and the other (@@lo@@) is the local loopback interface provided by the system. The @@ethX@@ interface is used to connect to this machine from other external hosts. So, look for the "@@inet addr:@@" entry in @@ethX@@. The following figure shows an example output. In this case, the network interface is eth2 and the IP address is @@192.168.11.132@@. Note that the actual values of @@X@@ in @@ethX@@ and the IP address can be different from machine to machine depending on network configurations.


%center%http:/uploads/CSE2003S09/Get_IP.gif"Get your IP address"


'''5. Connect to your Linux using ftp'''.\\


Windows has its own ftp client program by default. First, run the @@C:\Windows\system32\cmd.exe@@ program. This will open a new command window. In the prompt, type @@ftp 192.168.11.132@@. You should specify the exactly same IP address obtained from the previous step. If there is no problem, you will get the login prompt. Once you are logged in with the default account (username="@@user@@", password="@@user@@"), you will be able to exchange files between the Windows host and the Linux machine using the conventional ftp commands.


%center%http:/uploads/CSE2003S09/Check_ftp.gif"Check ftp from Windows"
to:
'''4. Find your IP address'''.\\


Find
the IP address of your Linux machine using the @@ifconfig@@ command (cf. step 4 in [[FTP|the previous document]]). Here, we assume that the Linux machine's IP address is @@192.168.11.132@@.



'''5. Access
the @@share@@ directory in Windows'''.\\


In Windows, open a new Internet Explorer and type @@\\192
.168.11.132\@@ as follows.


%center%http:/uploads/CSE2003S09/Access_share.gif"Accessing
the share directory"
Changed lines 54-56 from:
Click the icon of the @@share@@ directory, and press the right button of your mouse. Then, click @@Sharing Options@@. Check all the sharing options as follows:
to:
Click the icon of the @@share@@ directory, and press the right button of your mouse. Then, click @@Sharing Options@@. Check all the sharing options as show in the following figure, and then press @@Create Share@@ button.
Added lines 59-61:

Changed lines 43-46 from:
It will display the file browser on your home directory. Click the right button in your mouse and choose @@Create Folder@@ in the menu. And make a new directory named @@share@@. This will be the directory to be shared with Windows.
to:
It will display the file browser on your home directory. Click the right button of your mouse and choose @@Create Folder@@ in the menu. And make a new directory named @@share@@. This will be the directory to be shared with Windows.
Deleted lines 48-66:






You should activate @@inetd@@ daemon in order to get ftp service. The @@inetd@@ daemon can be started with the following command:


%block align=center bgcolor=#f0f9ff border='1px solid gray' padding=5px%@@root@desktop:~# @@%red%@@/etc/init.d/openbsd-inetd start@@%%


You can test whether the ftp server works fine or not by issuing the following command:


%block align=center bgcolor=#f0f9ff border='1px solid gray' padding=5px%@@root@desktop:~# @@%red%@@ftp localhost@@%%


This command let you connect to your own server (The ''localhost'' is a reserved hostname which indicates the current machine.). If everthing is fine, you will get the login prompt which is required to log in to your server by the ftp client. Use the default account (username="@@user@@", password="@@user@@"). You will be able to see the following greeting messages sent from the ftp server.
Changed lines 51-60 from:
%center%http:/uploads/CSE2003S09/Start_inetd.gif"Start inetd and check ftp"


'''4. Find your IP address'''.\\


In order to connect to your Linux machine from the Windows host
, you need to find the IP address which is assigned to the Linux machine. The VMware Player automatically assigns an IP address when it boots up. The IP address can be found by the "@@ifconfig@@" command:


%block align=center bgcolor=#f0f9ff border='1px solid gray' padding=5px%@@root@desktop:~# @@%red%@@ifconfig@@%%
to:
'''3. Give sharing options'''.\\


Click the icon of the @@share@@ directory, and press the right button of your mouse. Then
, click @@Sharing Options@@. Check all the sharing options as follows:


%center%http:/uploads/CSE2003S09/Sharing_options.gif"Give sharing options
"
Changed lines 43-44 from:

It will display the file browser on your home directory.
to:
It will display the file browser on your home directory. Click the right button in your mouse and choose @@Create Folder@@ in the menu. And make a new directory named @@share@@. This will be the directory to be shared with Windows.



%center%http:/uploads/CSE2003S09/Create_share.gif"Create a directory to share"
Changed lines 37-44 from:
Click @@Places->Home Folder@@.
to:
Click @@Places->Home Folder@@ in the top menu.


%center%http:/uploads/CSE2003S09/Start_file_browser.gif"Start a file browser"



It will display the file browser on your home directory.
Changed lines 24-39 from:
'''1. Install @@ftpd@@ and @@inetd@@'''.\\


The next step is to install @@ftpd@@ and @@inetd@@ as these programs are not installed by default on your Linux image. @@ftpd@@ is an ftp server and @@inetd@@ is a super-server daemon that manages various Internet services including ftp. These programs can be installed by the following command:

%block align=center bgcolor=#f0f9ff border='1px solid gray' padding=5px%
@@root@desktop:~# @@%red%@@apt-get install ftpd@@%%


The following figure shows what happens when you type the command
. Just say @@Y@@ when the system asks you if you are ready to install the program.


%center%http:/uploads/CSE2003S09/Install_ftpd.gif"Install ftpd and inetd"



'''3. Start @@inetd@@'''.\\
to:
'''1. Install @@samba@@'''.\\


Use the following command to install the @@samba@@ package on your Linux system.


%block align=center bgcolor=#f0f9ff border='1px solid gray' padding=5px%
@@root@desktop:~# @@%red%@@apt-get install samba@@%%



'''2. Make a directory to be shared with Windows'''
.\\


Click @@Places->Home Folder
@@.
Changed line 21 from:
First, you should be a superuser. Please refer to the previous [[FTP|document on setting up the ftp server]], and follow the same steps (step 1 and 2) to be a superuser.
to:
First, you should be a superuser. Please refer to the previous [[FTP|document on setting up the ftp server]], and follow the same steps (step 0 and 1) to be a superuser.
Changed line 21 from:
First, you should be a superuser. Please refer to the previous [[FTP|document on setting up the ftp server], and follow the same steps (step 1 and 2) to be a superuser.
to:
First, you should be a superuser. Please refer to the previous [[FTP|document on setting up the ftp server]], and follow the same steps (step 1 and 2) to be a superuser.
Changed lines 15-101 from:
Coming soon!
to:
Another way to share files between Windows (host OS) and Linux (guest OS running on the VMware Player) is to use [[http://www.samba.org|Samba]]. Samba is a free software re-implementation of SMB/CIFS networking protocol which is used to share files and directories among Windows machines.


'''0. Launch a terminal and be a superuser'''.\\


First, you should be a superuser. Please refer to the previous [[FTP|document on setting up the ftp server], and follow the same steps (step 1 and 2) to be a superuser.


'''1. Install @@ftpd@@ and @@inetd@@'''.\\


The next step is to install @@ftpd@@ and @@inetd@@ as these programs are not installed by default on your Linux image. @@ftpd@@ is an ftp server and @@inetd@@ is a super-server daemon that manages various Internet services including ftp. These programs can be installed by the following command:

%block align=center bgcolor=#f0f9ff border='1px solid gray' padding=5px%@@root@desktop:~# @@%red%@@apt-get install ftpd@@%%


The following figure shows what happens when you type the command. Just say @@Y@@ when the system asks you if you are ready to install the program.


%center%http:/uploads/CSE2003S09/Install_ftpd.gif"Install ftpd and inetd"



'''3. Start @@inetd@@'''.\\



You should activate @@inetd@@ daemon in order to get ftp service. The @@inetd@@ daemon can be started with the following command:


%block align=center bgcolor=#f0f9ff border='1px solid gray' padding=5px%@@root@desktop:~# @@%red%@@/etc/init.d/openbsd-inetd start@@%%


You can test whether the ftp server works fine or not by issuing the following command:


%block align=center bgcolor=#f0f9ff border='1px solid gray' padding=5px%@@root@desktop:~# @@%red%@@ftp localhost@@%%


This command let you connect to your own server (The ''localhost'' is a reserved hostname which indicates the current machine.). If everthing is fine, you will get the login prompt which is required to log in to your server by the ftp client. Use the default account (username="@@user@@", password="@@user@@"). You will be able to see the following greeting messages sent from the ftp server.


%center%http:/uploads/CSE2003S09/Start_inetd.gif"Start inetd and check ftp"


'''4. Find your IP address'''.\\


In order to connect to your Linux machine from the Windows host, you need to find the IP address which is assigned to the Linux machine. The VMware Player automatically assigns an IP address when it boots up. The IP address can be found by the "@@ifconfig@@" command:


%block align=center bgcolor=#f0f9ff border='1px solid gray' padding=5px%@@root@desktop:~# @@%red%@@ifconfig@@%%


This @@ifconfig@@ command prints out all the information related to network interfaces attached to your system. Normally, you will have at least two network interfaces; one (@@ethX@@) is the virtual Ethernet interface created by the VMware Player, and the other (@@lo@@) is the local loopback interface provided by the system. The @@ethX@@ interface is used to connect to this machine from other external hosts. So, look for the "@@inet addr:@@" entry in @@ethX@@. The following figure shows an example output. In this case, the network interface is eth2 and the IP address is @@192.168.11.132@@. Note that the actual values of @@X@@ in @@ethX@@ and the IP address can be different from machine to machine depending on network configurations.


%center%http:/uploads/CSE2003S09/Get_IP.gif"Get your IP address"


'''5. Connect to your Linux using ftp'''.\\


Windows has its own ftp client program by default. First, run the @@C:\Windows\system32\cmd.exe@@ program. This will open a new command window. In the prompt, type @@ftp 192.168.11.132@@. You should specify the exactly same IP address obtained from the previous step. If there is no problem, you will get the login prompt. Once you are logged in with the default account (username="@@user@@", password="@@user@@"), you will be able to exchange files between the Windows host and the Linux machine using the conventional ftp commands.


%center%http:/uploads/CSE2003S09/Check_ftp.gif"Check ftp from Windows"


'''6. Using Windows-based ftp client'''.\\


If you are not familar with the command line version of the ftp client, you can use other Windows-based ftp client programs such as FileZilla. The FileZilla program is a free ftp client available from http://filezilla-project.org. With FileZilla, you don't have to type @@get@@ or @@put@@ command by yourself. Just drag and drop whatever files you want.


The following figure shows how to setup your FileZilla to connect to your Linux machine. Remember you need to specify your own IP address obtained from step 4.


%center%http:/uploads/CSE2003S09/Filezilla_setup.gif"Setting up FileZilla"


Once connected, you can easily move files to and from the Linux machine. Enjoy
!



%center%http:/uploads/CSE2003S09/Filezilla.gif"Using FileZilla"
Changed lines 8-12 from:
%right%By Jin-Soo Kim\\
to:

%right%Jin-Soo Kim\\
%right%Computer Systems Laboratory\\
%right%Sungkyunkwan University
Added lines 1-11:
!! CSE2003: System Programming (Spring 2009)

----
!! Sharing files between Windows (host) and Linux (guest) using Samba


%right%March 17, 2009\\
%right%By Jin-Soo Kim\\


Coming soon!