Access Linux from Windows

本文详细介绍了在Linux系统中通过Samba服务器实现与Windows系统之间的文件共享,包括安装Samba、配置SMB配置文件、设置安全访问权限及添加Samba用户等步骤。

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.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值