Linux知识众多,发行版又广,为了避免每次着急使查资料的尴尬情况出现,特此将我平时可能用到的命令都记录下来,以方便后面使用。
/etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list
/etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list
/etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list
/etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list
/etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list
/etc/apt/sources.list /etc/apt/sources.list
/etc/apt/sources.list /etc/apt/sources.list
/etc/apt/sources.list /etc/apt/sources.list
/etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list
/etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list
/etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list /etc/apt/sources.list
-O /etc/yum.repos.d/CentOS-base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum update
yum makecache
这里我用的是CentOS7的更新源,其他源参考如下:
-O /etc/yum.repos.d/CentOS-base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
Ubuntu/Debian
CentOS
yum gcc
https://blog.csdn.net/vanarrow/article/details/configure install-config
Kali/Ubuntu/Debian
CentOS
chsh -s /bin/zsh
sh -c
clone git://github.com/zsh-users/zsh-autosuggestions /plugins/zsh-autosuggestions
pluginsgit zsh-autosuggestions
zsh
除了安装使用`yum以外,其他配置方法和上面其他发行版系统一样,这里就不再赘述了。
CentOS7安装zsh一些插件和macOS下安装相差不多,这里就简单提一下吧:
autojump
快捷目录跳转插件
在 中配置
输入命令生效配置后即可正常使用命令,下面是简单的演示效果:
$ ~
$ j 2 /root/test/23333
$ /root/test/23333
zsh-syntax-highlighting
命令输入正确会绿色高亮显示,可以有效地检测命令语法是否正确
在 中配置
输入命令生效配置
autosuggestions
终端下自动提示接下来可能要输入的命令,这个实际使用效率还是比较高的
在 中配置
输入命令生效配置
Ubuntu
居然报错了,内容如下:
手动解决依赖,这里是因为openssh-server是依赖于openssh-clien的,那我们手动安装下指定的版本的openssh-client
apt openssh-server
CentOS
Kali/Debian
Ubuntu
systemctl
/etc/init.d/ssh start
CentOS/Debian/Kali
systemctl sshd
systemctl start sshd
/root/.ssh/
id_rsa.pub authorized_keys
/etc/ssh/sshd_config
/etc/init.d/ssh restart
效果如下:
将服务器的rsa私钥下载下来,然后拷贝到自己的机器上。此时必须使用私钥匙登陆才可以成功:-i ~/Downloads/test_rsa root@10.211.55.9
假设有这样一个场景
想要自己的电脑保存这两台服务器的私钥的话,可以这样配置:
在 目录下创建 文件:
输入以下信息:
Host 2.2.2.2 IdentityFile ~/.ssh/id_rsa_b
然后设置私钥的权限:
/etc/ssh/sshd_config
/etc/init.d/ssh restart
systemctl restart sshd
最基本的连接方式:
FTP连接非默认端口:
或者:
一个完整的登录示例:
目录相关
rname redir delete mdelete
文件上传下载
退出
因为JDK官网需要登录验证才可以下载的原因,不能直接通过wget来下载tar.gz安装包了,得自己手动copy一下。
vim /etc/profile
末尾添加如下内容:
java -version
Centos7 自带Python2版本和pip2,所以我们只要直接安装Python3即可:
yum python36
python3 -V Python 3.6.8
pip3 -V pip 9.0.3 from /usr/lib/python3.6/site-packages python 3.6
pip --upgrade pip pip3 --upgrade pip
pip ipython pip3 ipython
安装pyenv
pyenv Python多版本管理神器,安装起来也很简单:
clone https://github.com/pyenv/pyenv.git ~/.pyenv
”’ ~/.zshrc zsh
基础入门使用可以参考我的这篇文章macOS pyenv入门使用记录
pip3安装
-r --include --include 目标路径
-r --include --exclude /home/sqlsec/Desktop/BBS/
用户名
-r 用户名
apt mysql-server
/etc/init.d/mysql start
mysql_secure_installation
apt mariadb-server
/etc/init.d/mysql start
mysql_secure_installation
systemctl start mariadb
systemctl mariadb
systemctl status mariadb
mysql_secure_installation
FLUSH PRIVILEGES;
以下所有操作都是以 root 用户执行
yum -y yum-utils device-mapper-persistent-data lvm2 yum-config-manager –add-repo https://download.docker.com/linux/centos/docker-ce.repo yum -y docker-ce docker-ce-cli containerd.io systemctl start docker yum -y epel-release yum -y python-pip pip --upgrade pip pip docker-compose
$ docker version Client: Docker Engine - Community Version: 19.03.5 API version: 1.40 Go version: go1.12.12 Git commit: 633a0ea Built: Wed Nov 13 07:25:41 2019 OS/Arch: linux/amd64 Experimental:
Server: Docker Engine - Community Engine: Version: 19.03.5 API version: 1.40 minimum version 1.12 Go version: go1.12.12 Git commit: 633a0ea Built: Wed Nov 13 07:24:18 2019 OS/Arch: linux/amd64 Experimental: containerd: Version: 1.2.10 GitCommit: b34a5c8af56e510852c35414db4c1f4fa6172339 runc: Version: 1.0.0-rc8+dev GitCommit: 3e425f80a8c931f88e6d94a8c831b9d5aa481657 docker-init: Version: 0.18.0 GitCommit: fec3683
$ docker-compose version docker-compose version 1.25.4, build unknown docker-py version: 4.1.0 CPython version: 3.6.8 OpenSSL version: OpenSSL 1.0.2k-fips 26 Jan 201
Hashcat是一款密码爆破神器,信息安全必备工具之一,特此写篇文章记录总结之,以备不时之需。
简介Hashcat是世界上最快的密码破解程序,是一个支持多平台、多算法的开源的分布式工具。 官方:https://hashcat.net/
Kali Linux白帽子必备操作系统,有时候重新安装又得折腾下,特此这里总结一下,减少一些不必要的坑。
更新源vim /etc/apt/sources.list 官方源记住这个官方源就好了,不要被网上辣鸡文章误导,官方源会自动选择最