debain基础知识
1.允许以root用户登录操作系统
默认情况下debian是不允许以root用户登录的,只能以其他用户登录系统中,然后su到root用户下进行操作。
1vim /etc/gdm3/daemon.conf
新增下面一行AllowRoot = true
[security]
AllowRoot = true
2修改/etc/pam.d/gdm-password
注释掉下面内容
#auth required pam_succeed_if.so user != root quiet_success
然后用systemctl reboot重启操作系统,就可以使用root用户登录操作系统了。
2.解决debain系统不能使用ssh软件连接终端的问题:
1SSH的安装
apt-get install openssh-server
apt-get install ssh
2把默认的配置文件全部注释掉,拷贝下列文件:
vim /etc/ssh/ssh_config
Host *
ForwardAgent no
ForwardX11 no
RhostsAuthentication no
RhostsRSAAuthentication no
RSAAuthentication yes
PasswordAuthentication yes
FallBackToRsh no
UseRsh no
BatchMode no
CheckHostIP yes
StrictHostKeyChecking no
IdentityFile ~/.ssh/identity
Port 22
Cipher blowfish
EscapeChar ~
3修改配置文件/etc/ssh/sshd_config
将
PermitRootLogin prohibit-password
修改为PermitRootLogin yes
没有就添手动加一行
4重启ssh服务
/sbin/service sshd restart
3配置镜像软件源:
1查看系统版本:root@debian:~# cat /etc/debian_version
2打开清华大学开源软件镜像站选择debain对应的版本复制
https://mirrors.tuna.tsinghua.edu.cn/help/debian/
3在配置文件中添加拷贝的镜像源地址
root@debian:~# vim /etc/apt/sources.list
4更新镜像源
root@debian:~# apt-get update
4打开linux常用的ls,ll等快捷键功能:
root@debian:~# vim .bashrc
root@debian:~# source .bashrc
5默认没有备份工具rsync,需要自己安装:root@debian:~# apt-get install rsync
6安装软件:
仅下载不安装:root@debian:~# apt-get install nginx -d
查看下载的软件:root@debian:~# ls /var/cache/apt/archives
查看下载的软件:root@debian:~# ll /var/cache/apt/archives
安装所有nginxdb包:
root@debian:~# cd /var/cache/apt/archives
root@debian:/var/cache/apt/archives# dpkg -i nginx*
软件安装后要执行解决依赖关系:root@debian:/var/cache/apt/archives# apt-get install -f
检测nginx是否安装成功:root@debian:/var/cache/apt/archives# nginx -t
7常用设置:
从普通用户切换到root用户:su root
安装运维工具包:apt install net-tools
查看ip:ip add
解决不显示中文字符执行命令:export LANG=C
查看网卡信息:vim /etc/network/interfaces
查看系统版本:root@debian:~# cat /etc/debian_version
查询网段:root@debian:~# cat /etc/resolv.conf
搜索软件包:root@debian:~# apt-cache search nginx
debain系统打开linux默认的常用命令,例如ls:
root@debian:~# vim .bashrc
root@debian:~# source .bashrc

浙公网安备 33010602011771号