Access Linux from Windows

来源:互联网 发布:sql语句更改字段类型 编辑:程序博客网 时间:2024/06/06 04:10

From: http://processors.wiki.ti.com/index.php/Booting_Linux_kernel_using_U-Boot

Installing a Samba Server


The samba server provides a way to access the contents of a Linux machine’s file-system from a Windows machine over a network connection. This provides a very useful way for sharing files between a Windows machine and a Linux machine. To install a Samba server, in a terminal shell, execute the following command.
sudo apt-get install samba

The default configuration of the samba server does not allow any access to the Linux machine’s file-system from a Windows machine for security reasons. Therefore, it is necessary to configure samba and specify which directories you wish to allow access to and who can access them. To keep things simple, we shall configure samba such that only users with user accounts on the Linux machine have read/write access to their home directories.

To allow users to access their home directories via samba, you need to edit “/etc/samba/smb.conf” with root permissions.
sudo gedit /etc/samba/smb.conf

Now locate the following text:
#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
;[homes]
; comment = Home Directories
; browseable = no

Un-comment the bottom 3 lines shown above by removing the ";" and select "yes" for "browseable" as shown below:
#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
[homes]
comment = Home Directories
browseable = yes

The above change will only allow users to view their home directories. Hence, to allow users to write to their home directory via samba, find the following text in the file “/etc/samba/smb.conf”.
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
; read only = yes

Un-comment the line "read only" above and set "read only" equal to "no" as shown below.
# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
read only = no

Save the changes to the file “/etc/samba/smb.conf” and restart the samba server by executing the following command to make the new configuration take effect.
sudo /etc/init.d/samba restart

Finally, to enable users to use samba, each user must be added as a samba user. For example, to add the UNIX user “joe” as a samba user the following command would be executed. The “smbpasswd” command will ask you for a password for the new samba user. You may use the UNIX password you have for the UNIX account.
sudo smbpasswd -a joe

To access your home directory using samba from a Windows host, on the Windows host open Windows Explorer and in the address box enter “\\<ubuntu-ip-address>\joe.” After entering the IP address in the Windows Explorer address box, if your username and password are different from that of your Windows username and password, you will be asked to enter the samba username and password for the account you wish to access.
原创粉丝点击