Samba: Server setup..

To make samba shard folder permission clear, there are 3 kind of permission need to be paid attention:

1. permission written in /etc/samba/smb.conf of certain folder

2. folder need to be shared by be labeled as samba_shared_t, check by ls -ldZ (Note: needed only while under SElinux environment)

3. folder's own permission according to the login-user. check it by ls -l, best to change the folder's owner by chown.

 

2 days passed, and I finally find it done with samba server.. with utube

to set up a samba server:

1. install samba;

2. add /etc/samba/smb.conf to the tail: (also if sure about safety of network environment, turn off smb encryption by adding 'smb encrypt = disabled' to [global] section of smb.conf)

[wwt]  # This is the shared folder name displayed in the guest
    path = /home/wwt # This is the dest folder in the host
    available = yes
    valid users = wwt root # space seperated [vital]
    writable = yes
    write list = wwt root # users guaranteed to write the folder
    browseable = yes
    public = yes
    workgroup = ADMIN # This line is for windows users to login, no use in linux

3. chcon -t samba_share_t /home/wwt -R (Changing SElinux security context) 

to make all the folder/file be samba_shared_t.

4. add samba user wwt/root [ the mentioned user wwt in the smb.conf]:

smbpasswd -a wwt
smbpasswd -a root

In linux guest:

smbclient -L 10.0.5.2
smbclient \\\\10.0.5.2\\wwt password

In windows guest:

win-r<CR>
\\10.0.5.2

 

the test finished.

but if want to put into real work circumstances.. we need yum install cifs-utils:

# first install the mount.cifs tool
mount.cifs //10.0.5.2/wwt /mnt/wwt -o user=wwt,pass=123456
# input the password
cd /mnt/wwt
# done..

------Another need----

We have 1 remote linux server, 1 local linux machine and 1 windows.

The need is to let the local linux sshfs mount the remote linux dir, and let windows access the files through samba service.

Several things to do:

1. the remote linux should have port 22 and sshd service enabled;

2. the local linux machine should sshfs mount the remote dir with option 'allow_other', by:

# Uncomment #user_allow_other in fuse.conf
vim /etc/fuse.conf
# sshfs mount remote dir
sshfs user@machine:/path/to/dir /local/path -C -o allow_other -o umask 0000 -o delay_connect -o reconnect -o IdentityFile=/home/.ssh/id_rsa

3. local linux machine should have samba installed (service port accessible), and configure the /etc/samba/smb.conf (there is no need to restart smbd.service), set user passwd by smbpasswd user...

4. windows side type \\localmachine

转载于:https://www.cnblogs.com/sansna/p/6078662.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值