#!/bin/bash# usage:,我来为大家科普一下关于linux安装samba服务器教程的过程?以下内容希望对你有帮助!

linux安装samba服务器教程的过程(linux基础入门知识)

linux安装samba服务器教程的过程

安装ubuntu系统

安装和开启SSH服务

批量创建用户和设置密码

#!/bin/bash

# usage:

# ./add-multi-user.sh users.txt

# sudo useradd -m -s /bin/bash <user_name>

for user_name in `cat $1`

do

echo $user_name

# -m: specify to create default home directory

# -s: specify the default shell to bash

sudo useradd -m -s /bin/bash $user_name

# set default password as “123”

echo “$user_name:123” | sudo chpasswd

done

user1

user2

user3

安装和批量配置samba服务

#!/bin/bash

for user_name in `cat $1`

do

echo config samba for $user_name …

# config smb.conf

echo “

[$user_name]

path = /home/$user_name

browseable = yes

writable = yes

valid users = $user_name

” | sudo tee -a /etc/samba/smb.conf

# add smb password for the user

echo -ne “123\n123\n” | sudo smbpasswd -a -s $user_name

echo “config success for $user_name”

echo

done

# restart samba service

sudo service smbd restart

批量添加sudo用户

#!/bin/bash

for user_name in `cat $1`

do

echo “add sudoer for $user_name”

sudo usermod -aG sudo $user_name

# force color prompt in login shell

sudo sed -i ‘s/#force_color_prompt/force_color_prompt/g’ /home/$user_name/.bashrc

done

安装和配置git

cat .reviewboardrc

## Current Repository ##

#REPOSITORY = “/home/disk/cameo-src/icore”

## User Configuration ##

USERNAME = “zhifu”

PASSWORD = “123456”

## Review Board Settings ##

REVIEWBOARD_URL = “http://172.22.102.205”

auto eth0

iface eth0 inet static

address 172.22.102.221

netmask 255.255.255.0

gateway 172.22.102.250

dns-nameservers 172.22.93.28 172.22.111.2 114.114.114.114

sudo vim /etc/default/grub

GRUB_CMDLINE_LINUX=””

改为

GRUB_CMDLINE_LINUX=”net.ifnames=0 biosdevname=0″

执行

sudo grub-mkconfig -o /boot/grub/grub.cfg

vim /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)

auto lo

iface lo inet loopback

auto eth0

iface eth0 inet static

address 192.168.101.111

netmask 255.255.255.0

gateway 192.168.101.1

dns-nameservers 172.22.93.28 172.22.111.2 114.114.114.114

64位环境下运行32位程序

sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386

sudo apt-get install libncurses5-dev:i386

sudo apt-get install zlib1g-dev:i386