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

linux安装samba服务器教程的过程_linux基础入门知识,第1张

linux安装samba服务器教程的过程_linux基础入门知识 安装ubuntu系统参考以下步骤进行安装http://blog.sciencenet.cn/blog-892035-1083295.html其中注意以下几个问题:制作安装U盘时,使用universal-usb-installer制成的启动U盘无法正常启动,使用UltraISO制作的可以正常启动,UltraISO制作过程参考:https://blog.csdn.net/fu6543210/article/details/79722615安装和开启SSH服务系统安装后,默认是没有安装和开启SSH服务的,安装和开启过程如下:sudo apt-get install openssh-serversudo service ssh start按上述步骤安装和开启后,默认情况下SSH是开机自启动的,不需要再额外进行配置https://www.cnblogs.com/EasonJim/p/7189509.html批量创建用户和设置密码编写shell脚本用于批量创建用户,并且设置统一密码为123,其中要创建的用户名存放于文件users.txt中脚本如下:#!/bin/bash# usage:# ./add-multi-user.sh users.txt# sudo useradd -m -s /bin/bash <user_name>for user_name in `cat $1`doecho $user_name# -m: specify to create default home directory# -s: specify the default shell to bashsudo useradd -m -s /bin/bash $user_name# set default password as “123”echo “$user_name:123” | sudo chpasswddoneusers.txt内容如下:user1user2user3安装和批量配置samba服务安装sudo apt-get install samba备份smb.confsudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak编写shell脚本进行配置,待创建的用户仍存于users.txt,脚本内容如下:#!/bin/bashfor user_name in `cat $1`doecho config samba for $user_name …# config smb.confecho “[$user_name]path = /home/$user_namebrowseable = yeswritable = yesvalid users = $user_name” | sudo tee -a /etc/samba/smb.conf# add smb password for the userecho -ne “123\n123\n” | sudo smbpasswd -a -s $user_nameecho “config success for $user_name”echodone# restart samba servicesudo service smbd restart参考:https://blog.csdn.net/wbaction/article/details/72758673批量添加sudo用户一个简单而快捷的方式为:sudo usermod -aG sudo <username>利用上述基本命令,批量添加的脚本如下(同时包括了force color prompt的修改):#!/bin/bashfor user_name in `cat $1`doecho “add sudoer for $user_name”sudo usermod -aG sudo $user_name# force color prompt in login shellsudo sed -i ‘s/#force_color_prompt/force_color_prompt/g’ /home/$user_name/.bashrcdone安装和配置git安装很简单sudo apt-get install git与git服务器的交互配置把旧服务器下用户主目录下的.ssh拷贝至新的用户主目录下即可其他git的配置根据自己的情况自定义,如user和mail等安装和配置post review下载对应系统python版本的RBTools工具(egg文件,系统python版本可以通过执行python看到,ubuntu 16.04 下默认为Python 2.7.12)https://downloads.reviewboard.org/releases/RBTools/0.4/RBTools-0.4.3-py2.7.egg#md5=c28da8a7f961982958b89a2d17d2bbdf安装python setup toolssudo apt-get install python-setuptools安装RBTools的egg文件easy_install RBTools-0.4.3-py2.7.egg安装完毕后,在用户home目录下,配置review board用户和密码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”配置IP地址、子网掩码、网关和DNS server等sudo vim /etc/network/interfaces在后面添加(其中eth0为要添加的网卡名称)auto eth0iface eth0 inet staticaddress 172.22.102.221netmask 255.255.255.0gateway 172.22.102.250dns-nameservers 172.22.93.28 172.22.111.2 114.114.114.114修改网卡名称为eth0sudo vim /etc/default/grubGRUB_CMDLINE_LINUX=””改为GRUB_CMDLINE_LINUX=”net.ifnames=0 biosdevname=0″执行sudo grub-mkconfig -o /boot/grub/grub.cfgvim /etc/network/interfaces更改原有网卡名称为eth0比如,在原有的内容之后添加eth0(假定配置的IP为192.168.101.111):# interfaces(5) file used by ifup(8) and ifdown(8)auto loiface lo inet loopbackauto eth0iface eth0 inet staticaddress 192.168.101.111netmask 255.255.255.0gateway 192.168.101.1dns-nameservers 172.22.93.28 172.22.111.2 114.114.114.114设置网卡开机自启动sudo systemctl enable networking.service重启系统参考:http://blog.51cto.com/270142877/2047563https://blog.csdn.net/wenwenxiong/article/details/5293753964位环境下运行32位程序得益于ubuntu系统的multiarch支持,我们可以在64位系统下运行相应的32位程序添加32位程序multiarch支持(16.04下默认支持):sudo dpkg –add-architecture i386为32位架构添加库支持(“:i386″后缀表示是32位库),当出现类似库的问题时,都可以通过这种方式来安装32位的库sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386sudo apt-get install libncurses5-dev:i386sudo apt-get install zlib1g-dev:i386

欢迎分享,转载请注明来源:内存溢出

原文地址: https://www.outofmemory.cn/tougao/661546.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-18
下一篇 2022-04-18

发表评论

登录后才能评论

评论列表(0条)

保存