linux-samba-普通用户当前shell-静态IP


++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

sudo apt-get install samba

mkdir Share
chmod 777 Share

Samba设置共享文件夹让Windows匿名访问:

# 如果在安装ubuntu server时没有选择samba file server包,可以用如下命令安装,如果安装了可跳过这一步。
$ sudo apt-get install smbclient
# 选择需要共享的文件夹,并设置为最高权限,这里使用 /var/workspace
# 切记不要在/root下面设置共享目录,会导致windows下无法访问
$ chmod 777 -R /var/workspace
# 备份samba配置文件
$ cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
# 编辑samba配置文件,设置共享
$ sudo gedit /etc/samba/smb.conf
# 将smb.conf替换成下面内容,[workspace]段的路径自行更换

[global]
security = share
display charset = UTF-8
unix charset = UTF-8
dos charset = cp936
guest account = nobody
workgroup = WORKGROUP
server string = %h server (Samba, Ubuntu)

[share]
comment = ubuntu share
path = /home/chenxiaohui/Share
public = yes
writable = yes
browseable = yes
guest ok = yes
create mask = 0777
directory mask = 0777


# 重启samba服务
$ /etc/init.d/smbd restart
# 在Windows的资源管理器中,在地址栏直接输入Ubuntu Server的IP,即可访问。


不能使用TAB键、上下键,命令行不显示当前路径的解决
因默认ubuntu创建的普通帐号,默认shell为/bin/sh,而这不支持tab等键的,所以将「指定用户」帐号的shell改为/bin/bash就可以了。

1.查看当前的shell:
# echo $SHELL
/bin/sh
2.修改shell为/bin/bash:
# usermod -s /bin/bash 用户名
静态IP
vi /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
address 10.19.1.111
netmask 255.255.0.0
gateway 10.19.1.1
vi /etc/resolv.conf

nameserver 10.19.1.1
nameserver 8.8.8.8
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值