文章目录
Ubuntu 部署
- System Install
- Setup the login account by
root
- Disable/enable iptables for system
- Update the apt-get soft source
- Install vim
- Set the network name
- Set login the system with ssh service by secure_CRT
0. 本文参考的材料由于时间过长导致无法在文档中列举出来。如果您发现文章内有您的内容并认为需要删除的话,请您留言,我一定会删除。先行谢过。
1. System Install
- 进入系统安装界面,一路下一步就可以,其中硬盘安装模式推荐选择擦除所有。用户名和机器名推荐下面:
##2. System initialization
###2.1 设置喜好:terminal
- Login system.
- lock to launcher
2.2 Login by root
- Enable the root account
vi /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
set greeter-show-manual-login=true - Enable it by echo
- Set the root password
ubuntu#passwd root
- 解决root account login error;
set /root/.profile modify mesg n for tty -s && mesg n
# sed -i 's/mesg n/tty -s \&\& mesg n/' /root/.profile
- Reboot system
# reboot
- login by root
2.3 Set the network
- Set the network name
- vim /etc/default/grub
- add “GRUB_CMDLINE_LINUX” after params net.ifnames=0 biosdevname=0
- Update-grub update the grub config
- reboot the system
- ifconfig check the network name
- Set the network config
auto eth0
iface eth0 inet static
netmask 255.255.0.0
gateway 10.0.0.1
address 10.0.10.210
- Restart the network
Service networking restart - Check the network status
ifconfig
3. Soft server install
3.1 apt-get source update
- 更新apt-get source
https://www.linuxidc.com/Linux/2017-11/148627.html - 寻找国内镜像源
https://mirrors.tuna.tsinghua.edu.cn/help/ubuntu/
- 修改source list
- 更新源
不报错则通过
- 测试
- Comand for apt-get
sudo apt-get update 更新源
sudo apt-get install package 安装包
sudo apt-get remove package 删除包
sudo apt-cache search package 搜索软件包
sudo apt-cache show package 获取包的相关信息,如说明、大小、版本等
sudo apt-get install package --reinstall 重新安装包
sudo apt-get -f install 修复安装
sudo apt-get remove package --purge 删除包,包括配置文件等
sudo apt-get build-dep package 安装相关的编译环境
sudo apt-get upgrade 更新已安装的包
sudo apt-get dist-upgrade 升级系统
sudo apt-cache depends package 了解使用该包依赖那些包
sudo apt-cache rdepends package 查看该包被哪些包依赖
sudo apt-get source package 下载该包的源代码
sudo apt-get clean && sudo apt-get autoclean 清理无用的包
sudo apt-get check 检查是否有损坏的依赖
3.2 Install vim
- Command
apt-get install vim - Setup vim
/etc/vim/vimrc
" Only do this part when compiled with support for autocommands
if has("autocmd")
augroup redhat
autocmd!
" In text files, always limit the width of text to 78 characters
autocmd BufRead *.txt set tw=78
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal! g'\"" |
\ endif
" don't write swapfile on most commonly used directories for NFS mounts or USB sticks
autocmd BufNewFile,BufReadPre /media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
" start with spec file template
autocmd BufNewFile *.spec 0r /usr/share/vim/vimfiles/template.spec
augroup END
endi
3.4 Install wireshark
- Command
apt-get install wireshark - Setup ssh
记得中间选择yes
修改/etc/wireshark/init.lua 中的disable_lua=false为 disable_lua = true 就可以了,这样就不会显示Lua错误
- restart service
service sshd restart - setup when the system is reboot
vim /etc/rc.local
3.3 enable login root by ssh
1. Install the openssh-server
root@Robot-F:~# apt install openssh-server
2. Setup the sshd-config
PermitRootLogin yes
3. Enable the ssh server
4. Disable/enable iptables
- Disable iptables
- Enable iptables
ufw enable - uninstall iptables
apt-get remove iptables - Other iptables command
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F