linux基本项目环境搭建

linux基本项目环境搭建

java环境搭建

获取java源码包

将本地jdk-8u144-linux-x64.tar.gz通过xftp上传到ECS的指定目录下(一般为/usr/local/java)

解压

tar zxvf jdk-8u144-linux-x64.tar.gz
z:调用gzip命令在文件打包过程中压缩/解压文件
x:打包文档中还原出文件
v:显示命令执行过程
f:指定备份文件

配置环境变量

vim /etc/profile
在文件末尾加上

#set java environment
JAVA_HOME=/usr/local/java/jdk1.8.0_144
CLASSPATH=.:$JAVA_HOME/lib.tools.jar
PATH=$JAVA_HOME/bin:$PATH
export JAVA_HOME CLASSPATH PATH

使配置文件生效

source /etc/profile

验证

[root@iZwz9938t1plpkhn7ajjkrZ java]# java -version
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)

nginx安装

下载(java也可用此方法下载)

[root@hostname nginx]# ll
total 0
[root@hostname nginx]# wget http://nginx.org/download/nginx-1.12.2.tar.gz
--2019-03-04 21:51:00--  http://nginx.org/download/nginx-1.12.2.tar.gz
Resolving nginx.org (nginx.org)... 95.211.80.227, 62.210.92.35, 2001:1af8:4060:a004:21::e3
Connecting to nginx.org (nginx.org)|95.211.80.227|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 981687 (959K) [application/octet-stream]
Saving to: ‘nginx-1.12.2.tar.gz’

100%[========================================================================================================================>] 981,687      151KB/s   in 6.5s   

2019-03-04 21:51:07 (148 KB/s) - ‘nginx-1.12.2.tar.gz’ saved [981687/981687]

[root@iZwz9ezkmfgg9sw1ujpt5zZ nginx]# ll
total 960
-rw-r--r-- 1 root root 981687 Oct 17  2017 nginx-1.12.2.tar.gz

解压

tar -zxvf nginx-1.12.2.tar.gz

[root@hostname nginx-1.12.2]# ll
total 724
drwxr-xr-x 6 1001 1001   4096 Mar  4 21:54 auto
-rw-r--r-- 1 1001 1001 278202 Oct 17  2017 CHANGES
-rw-r--r-- 1 1001 1001 423948 Oct 17  2017 CHANGES.ru
drwxr-xr-x 2 1001 1001   4096 Mar  4 21:54 conf
-rwxr-xr-x 1 1001 1001   2481 Oct 17  2017 configure
drwxr-xr-x 4 1001 1001   4096 Mar  4 21:54 contrib
drwxr-xr-x 2 1001 1001   4096 Mar  4 21:54 html
-rw-r--r-- 1 1001 1001   1397 Oct 17  2017 LICENSE
drwxr-xr-x 2 1001 1001   4096 Mar  4 21:54 man
-rw-r--r-- 1 1001 1001     49 Oct 17  2017 README
drwxr-xr-x 9 1001 1001   4096 Mar  4 21:54 src

配置(configure)

引用 http://blog.sina.com.cn/s/blog_406127500101dsmy.html
源码的安装一般由3个步骤组成:配置(configure)、编译(make)、安装(make install)。

Configure是一个可执行脚本,它有很多选项,在待安装的源码路径下使用命令./configure –help输出详细的选项列表。

其中–prefix选项是配置安装的路径,如果不配置该选项,安装后可执行文件默认放在/usr /local/bin,库文件默认放在/usr/local/lib,配置文件默认放在/usr/local/etc,其它的资源文件放在/usr /local/share,比较凌乱。

如果配置–prefix,如:
./configure --prefix=/usr/local/test
可以把所有资源文件放在/usr/local/test的路径中,不会杂乱。
用了—prefix选项的另一个好处是卸载软件或移植软件。当某个安装的软件不再需要时,只须简单的删除该安装目录,就可以把软件卸载得干干净净;移植软件只需拷贝整个目录到另外一个机器即可(相同的操作系统)。

当然要卸载程序,也可以在原来的make目录下用一次make uninstall,但前提是make文件指定过uninstall。

[root@iZwz9ezkmfgg9sw1ujpt5zZ nginx-1.12.2]# ./configure --prefix=/usr/local/nginx/
checking for OS
 + Linux 3.10.0-693.2.2.el7.x86_64 x86_64
checking for C compiler ... found
 + using GNU C compiler
 + gcc version: 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) 

 ...

checking for PCRE library in /usr/include/pcre/ ... not found
checking for PCRE library in /usr/pkg/ ... not found
checking for PCRE library in /opt/local/ ... not found

./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.

缺少PCRE library,正则表达式库,nginx中location匹配要用到的一种。
安装 正则表达式库

[root@iZwz9ezkmfgg9sw1ujpt5zZ nginx-1.12.2]# yum install pcre
Loaded plugins: fastestmirror
base                                                                                                                                       | 3.6 kB  00:00:00     
epel                                                                                                                                       | 4.7 kB  00:00:00     
extras                                                                                                                                     | 3.4 kB  00:00:00     
updates                                                                                                                                    | 3.4 kB  00:00:00     
(1/7): epel/x86_64/group_gz                                                                                                                |  88 kB  00:00:00     
(2/7): base/7/x86_64/group_gz                                                                                                              | 166 kB  00:00:00     
(3/7): epel/x86_64/updateinfo                                                                                                              | 960 kB  00:00:00     
(4/7): base/7/x86_64/primary_db                                                                                                            | 6.0 MB  00:00:00     
(5/7): extras/7/x86_64/primary_db                                                                                                          | 180 kB  00:00:00     
(6/7): updates/7/x86_64/primary_db                                                                                                         | 2.4 MB  00:00:00     
(7/7): epel/x86_64/primary_db                                                                                                              | 6.6 MB  00:00:00     
Determining fastest mirrors
Package pcre-8.32-17.el7.x86_64 already installed and latest version
Nothing to do
[root@iZwz9ezkmfgg9sw1ujpt5zZ nginx-1.12.2]# yum install pcre-dev
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
No package pcre-dev available.
Error: Nothing to do	
[root@iZwz9ezkmfgg9sw1ujpt5zZ nginx-1.12.2]# 

可以安装的标志

Configuration summary
  + using system PCRE library
  + OpenSSL library is not used
  + using system zlib library

  nginx path prefix: "/usr/local/nginx/"
  nginx binary file: "/usr/local/nginx//sbin/nginx"
  nginx modules path: "/usr/local/nginx//modules"
  nginx configuration prefix: "/usr/local/nginx//conf"
  nginx configuration file: "/usr/local/nginx//conf/nginx.conf"
  nginx pid file: "/usr/local/nginx//logs/nginx.pid"
  nginx error log file: "/usr/local/nginx//logs/error.log"
  nginx http access log file: "/usr/local/nginx//logs/access.log"
  nginx http client request body temporary files: "client_body_temp"
  nginx http proxy temporary files: "proxy_temp"
  nginx http fastcgi temporary files: "fastcgi_temp"
  nginx http uwsgi temporary files: "uwsgi_temp"
  nginx http scgi temporary files: "scgi_temp"

[root@iZwz9ezkmfgg9sw1ujpt5zZ nginx-1.12.2]# 

编译和安装

[root@iZwz9ezkmfgg9sw1ujpt5zZ nginx-1.12.2]# make && make install
make -f objs/Makefile
make[1]: Entering directory `/usr/local/nginx/nginx-1.12.2'
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/nginx.o \
	src/core/nginx.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_log.o \
	src/core/ngx_log.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_palloc.o \
	src/core/ngx_palloc.c
cc -c -pipe  -O -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror -g  -I src/core -I src/event -I src/event/modules -I src/os/unix -I objs \
	-o objs/src/core/ngx_array.o \
	src/core/ngx_array.c
.
.
.
cp conf/scgi_params \
	'/usr/local/nginx//conf/scgi_params.default'
test -f '/usr/local/nginx//conf/nginx.conf' \
	|| cp conf/nginx.conf '/usr/local/nginx//conf/nginx.conf'
cp conf/nginx.conf '/usr/local/nginx//conf/nginx.conf.default'
test -d '/usr/local/nginx//logs' \
	|| mkdir -p '/usr/local/nginx//logs'
test -d '/usr/local/nginx//logs' \
	|| mkdir -p '/usr/local/nginx//logs'
test -d '/usr/local/nginx//html' \
	|| cp -R html '/usr/local/nginx/'
test -d '/usr/local/nginx//logs' \
	|| mkdir -p '/usr/local/nginx//logs'
make[1]: Leaving directory `/usr/local/nginx/nginx-1.12.2'
[root@iZwz9ezkmfgg9sw1ujpt5zZ nginx-1.12.2]# ll

启动

[root@iZwz9ezkmfgg9sw1ujpt5zZ nginx]# ./sbin/nginx 
[root@iZwz9ezkmfgg9sw1ujpt5zZ nginx]# ps -aux | grep nginx
root     26422  0.0  0.0  20492   612 ?        Ss   09:08   0:00 nginx: master process ./sbin/nginx
nobody   26423  0.0  0.0  20936  1336 ?        S    09:08   0:00 nginx: worker process
root     26431  0.0  0.0 112660   964 pts/0    S+   09:08   0:00 grep --color=auto nginx
[root@iZwz9ezkmfgg9sw1ujpt5zZ nginx]# netstat -ant
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State      
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN     
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN     
tcp        0      0 172.18.45.156:39316     100.100.30.25:80        ESTABLISHED
tcp        0     52 172.18.45.156:22        59.68.29.48:48314       ESTABLISHED
[root@iZwz9ezkmfgg9sw1ujpt5zZ nginx]# 

php安装

下载

下载页面:http://cn2.php.net/get/php-7.1.6.tar.gz/from/a/mirror

下载连接:http://cn2.php.net/get/php-7.1.6.tar.gz/from/this/mirror

解压

tar -zxvf php-7.1.6.tar.gz

[root@iZwz9ezkmfgg9sw1ujpt5zZ php-7.1.6]# ll
total 4276
-rw-rw-r--  1 1000 1000   82506 Jun  7  2017 acinclude.m4
-rw-rw-r--  1 1000 1000  312883 Jun  7  2017 aclocal.m4
drwxrwxr-x  2 1000 1000    4096 Jun  7  2017 appveyor
drwxrwxr-x  2 1000 1000    4096 Jun  7  2017 build
-rwxrwxr-x  1 1000 1000     772 Jun  7  2017 buildconf
-rw-rw-r--  1 1000 1000     334 Jun  7  2017 buildconf.bat
-rw-rw-r--  1 1000 1000   11982 Jun  7  2017 CODING_STANDARDS
-rw-rw-r--  1 1000 1000   42938 Jun  7  2017 config.guess
-rw-rw-r--  1 1000 1000   35987 Jun  7  2017 config.sub
-rwxrwxr-x  1 1000 1000 2759190 Jun  7  2017 configure
-rw-rw-r--  1 1000 1000   46774 Jun  7  2017 configure.in
-rw-rw-r--  1 1000 1000    3163 Jun  7  2017 CONTRIBUTING.md
-rw-rw-r--  1 1000 1000      91 Jun  7  2017 CREDITS
drwxrwxr-x 75 1000 1000    4096 Jun  7  2017 ext
-rw-rw-r--  1 1000 1000   20917 Jun  7  2017 EXTENSIONS
-rw-rw-r--  1 1000 1000     137 Jun  7  2017 footer
-rw-rw-r--  1 1000 1000    1776 Jun  7  2017 generated_lists
-rwxrwxr-x  1 1000 1000     581 Jun  7  2017 genfiles
-rw-rw-r--  1 1000 1000    1143 Jun  7  2017 header
-rw-rw-r--  1 1000 1000   87836 Jun  7  2017 INSTALL
-rw-rw-r--  1 1000 1000       0 Jun  7  2017 install-sh
-rw-rw-r--  1 1000 1000    3218 Jun  7  2017 LICENSE
-rw-rw-r--  1 1000 1000  199728 Jun  7  2017 ltmain.sh
drwxrwxr-x  3 1000 1000    4096 Jun  7  2017 main
-rwxrwxr-x  1 1000 1000    4129 Jun  7  2017 makedist
-rw-rw-r--  1 1000 1000    1088 Jun  7  2017 Makefile.frag
-rw-rw-r--  1 1000 1000    2485 Jun  7  2017 Makefile.gcov
-rw-rw-r--  1 1000 1000    7236 Jun  7  2017 Makefile.global
-rw-rw-r--  1 1000 1000    5317 Jun  7  2017 makerpm
-rw-rw-r--  1 1000 1000       0 Jun  7  2017 missing
-rw-rw-r--  1 1000 1000       0 Jun  7  2017 mkinstalldirs
drwxrwxr-x  2 1000 1000    4096 Jun  7  2017 netware
-rw-rw-r--  1 1000 1000  135093 Jun  7  2017 NEWS
drwxrwxr-x  2 1000 1000    4096 Jun  7  2017 pear
-rw-rw-r--  1 1000 1000    1489 Jun  7  2017 php7.spec.in
-rw-rw-r--  1 1000 1000    2523 Jun  7  2017 php.gif
-rw-rw-r--  1 1000 1000   71064 Jun  7  2017 php.ini-development
-rw-rw-r--  1 1000 1000   71096 Jun  7  2017 php.ini-production
-rw-rw-r--  1 1000 1000    7010 Jun  7  2017 README.EXT_SKEL
-rw-rw-r--  1 1000 1000    5026 Jun  7  2017 README.GIT-RULES
-rw-rw-r--  1 1000 1000    5417 Jun  7  2017 README.input_filter
-rw-rw-r--  1 1000 1000    3426 Jun  7  2017 README.MAILINGLIST_RULES
-rw-rw-r--  1 1000 1000    1608 Jun  7  2017 README.md
-rw-rw-r--  1 1000 1000    6040 Jun  7  2017 README.namespaces
-rw-rw-r--  1 1000 1000    5237 Jun  7  2017 README.NEW-OUTPUT-API
-rw-rw-r--  1 1000 1000    7528 Jun  7  2017 README.PARAMETER_PARSING_API
-rw-rw-r--  1 1000 1000   19766 Jun  7  2017 README.REDIST.BINS
-rw-rw-r--  1 1000 1000   12934 Jun  7  2017 README.RELEASE_PROCESS
-rw-rw-r--  1 1000 1000    5086 Jun  7  2017 README.SELF-CONTAINED-EXTENSIONS
-rw-rw-r--  1 1000 1000   15355 Jun  7  2017 README.STREAMS
-rw-rw-r--  1 1000 1000    8126 Jun  7  2017 README.SUBMITTING_PATCH
-rw-rw-r--  1 1000 1000    6695 Jun  7  2017 README.TESTING
-rw-rw-r--  1 1000 1000    4958 Jun  7  2017 README.TESTING2
-rw-rw-r--  1 1000 1000    4261 Jun  7  2017 README.UNIX-BUILD-SYSTEM
-rw-rw-r--  1 1000 1000     109 Jun  7  2017 README.WIN32-BUILD-SYSTEM
-rwxrwxr-x  1 1000 1000   82234 Jun  7  2017 run-tests.php
drwxrwxr-x 10 1000 1000    4096 Jun  7  2017 sapi
drwxrwxr-x  4 1000 1000    4096 Jun  7  2017 scripts
-rwxrwxr-x  1 1000 1000    2104 Jun  7  2017 server-tests-config.php
-rwxrwxr-x  1 1000 1000   52726 Jun  7  2017 server-tests.php
-rwxrwxr-x  1 1000 1000     108 Jun  7  2017 snapshot
-rw-rw-r--  1 1000 1000      10 Jun  7  2017 stamp-h.in
-rw-rw-r--  1 1000 1000       1 Jun  7  2017 stub.c
drwxrwxr-x 10 1000 1000    4096 Jun  7  2017 tests
drwxrwxr-x  3 1000 1000    4096 Jun  7  2017 travis
drwxrwxr-x  3 1000 1000    4096 Jun  7  2017 TSRM
-rw-rw-r--  1 1000 1000   23356 Jun  7  2017 UPGRADING
-rw-rw-r--  1 1000 1000    3418 Jun  7  2017 UPGRADING.INTERNALS
-rwxrwxr-x  1 1000 1000     159 Jun  7  2017 vcsclean
drwxrwxr-x  3 1000 1000    4096 Jun  7  2017 win32
drwxrwxr-x  4 1000 1000    4096 Jun  7  2017 Zend

配置,编译和安装

官网配置:http://php.net/manual/zh/install.unix.nginx.php

./configure --prefix=/usr/local/php 
--with-apxs2=/usr/local/httpd/bin/apxs 
--with-config-file-path=/usr/local/lib 
--with-pdo-mysql=/usr/local/mysql 
--with-zlib-dir=/usr/lib
./configure --prefix=/usr/local/php 
--with-apxs2=/usr/local/httpd/bin/apxs 
--with-config-file-path=/usr/local/lib 
--with-pdo-mysql=/usr/local/mysql 
--with-zlib-dir=/usr/lib

--with-apxs2=/usr/sbin/apxs
--with-apxs2=/usr/sbin/apxs
--with-mysql=/usr
--with-mysqli=/usr/bin/mysql_config

[root@iZwz9ezkmfgg9sw1ujpt5zZ php-7.1.6]# make install
Installing shared extensions:     /usr/local/php/lib/php/extensions/no-debug-non-zts-20160303/
Installing PHP CLI binary:        /usr/local/php/bin/
。。。
nstalling PEAR environment:      /usr/local/php/lib/php/
[PEAR] Archive_Tar    - installed: 1.4.2
[PEAR] Console_Getopt - installed: 1.4.1
[PEAR] Structures_Graph- installed: 1.1.1
[PEAR] XML_Util       - installed: 1.4.2
[PEAR] PEAR           - installed: 1.10.4
Wrote PEAR system config file at: /usr/local/php/etc/pear.conf
You may want to add: /usr/local/php/lib/php to your php.ini include_path
/usr/local/php/php-7.1.6/build/shtool install -c ext/phar/phar.phar /usr/local/php/bin
ln -s -f phar.phar /usr/local/php/bin/phar
Installing PDO headers:           /usr/local/php/include/php/ext/pdo/
[root@iZwz9ezkmfgg9sw1ujpt5zZ php-7.1.6]#

创建配置文件

[root@iZwz9ezkmfgg9sw1ujpt5zZ php-7.1.6]# cp php.ini-development /usr/local/php/php.ini
[root@iZwz9ezkmfgg9sw1ujpt5zZ etc]# ll
total 16
-rw-r--r-- 1 root root 1233 Mar  5 11:23 pear.conf
-rw-r--r-- 1 root root 4463 Mar  5 11:22 php-fpm.conf.default
drwxr-xr-x 2 root root 4096 Mar  5 11:22 php-fpm.d
[root@iZwz9ezkmfgg9sw1ujpt5zZ etc]# cp php-fpm.conf.default php-fpm.conf

[root@iZwz9ezkmfgg9sw1ujpt5zZ etc]# cd php-fpm.d
[root@iZwz9ezkmfgg9sw1ujpt5zZ php-fpm.d]# ll
total 20
-rw-r--r-- 1 root root 18517 Mar  5 11:22 www.conf.default
[root@iZwz9ezkmfgg9sw1ujpt5zZ php-fpm.d]# cp www.conf.default www.conf

启动

[root@iZwz9ezkmfgg9sw1ujpt5zZ php]# ps -ef|grep php
root     13603     1  0 14:48 ?        00:00:00 php-fpm: master process (/usr/local/php/etc/php-fpm.conf)
nobody   13604 13603  0 14:48 ?        00:00:00 php-fpm: pool www
nobody   13605 13603  0 14:48 ?        00:00:00 php-fpm: pool www
root     13608 10402  0 14:49 pts/0    00:00:00 grep --color=auto php

git安装

[root@iZwz9938t1plpkhn7ajjkrZ local]# yum install git
Loaded plugins: fastestmirror
base                                                                                             | 3.6 kB  00:00:00     
epel                                                                                             | 4.7 kB  00:00:00     
extras                                                                                           | 3.4 kB  00:00:00     
updates                                                                                          | 3.4 kB  00:00:00     
(1/7): base/7/x86_64/group_gz                                                                    | 166 kB  00:00:00     
...
Installed:
  git.x86_64 0:1.8.3.1-20.el7                                                                                           

Dependency Installed:
  perl-Error.noarch 1:0.17020-2.el7     perl-Git.noarch 0:1.8.3.1-20.el7     perl-TermReadKey.x86_64 0:2.30-20.el7    
  rsync.x86_64 0:3.1.2-4.el7           

Complete!
[root@iZwz9938t1plpkhn7ajjkrZ local]# git --version
git version 1.8.3.1

位置

[root@iZwz9938t1plpkhn7ajjkrZ git-core]# pwd
/usr/libexec/git-core
[root@iZwz9938t1plpkhn7ajjkrZ git-core]# ll
total 176032
-rwxr-xr-x 113 root root 1523792 Nov 20 00:06 git
-rwxr-xr-x 113 root root 1523792 Nov 20 00:06 git-add
-rwxr-xr-x   1 root root   36655 Nov 20 00:06 git-add--interactive
-rwxr-xr-x   1 root root   22361 Nov 20 00:05 git-am
...
-rwxr-xr-x 113 root root 1523792 Nov 20 00:06 git-verify-tag
-rwxr-xr-x   1 root root    4215 Nov 20 00:05 git-web--browse
-rwxr-xr-x 113 root root 1523792 Nov 20 00:06 git-whatchanged
-rwxr-xr-x 113 root root 1523792 Nov 20 00:06 git-write-tree
drwxr-xr-x   2 root root    4096 Mar  6 09:49 mergetools
[root@iZwz9938t1plpkhn7ajjkrZ git-core]# 

配置

配置用户名与邮箱,仅仅作为提交用户身份证(待测试)

[root@izwz91rl2qyews1sgkymi9z ~]# git config --global user.name "设置一个用户名,字符串A"
[root@izwz91rl2qyews1sgkymi9z ~]# git config --global user.email "你的邮箱,字符串B"

查看
进入$HOME(/root,可用echo输出验证),会有一个.gitconfig文件。

[root@izwz91rl2qyews1sgkymi9z ~]# cat .gitconfig 
[user]
	name = 前面的字符串A
	email = 前面的字符串B
[root@izwz91rl2qyews1sgkymi9z ~]# pwd
/root
[root@izwz91rl2qyews1sgkymi9z ~]# 

生成SSH公钥
将生成的公钥放在GitHub上面

[root@iZwz9938t1plpkhn7ajjkrZ ~]# cat .gitconfig 
[user]
	name = gczx
	email = [email protected]
[root@iZwz9938t1plpkhn7ajjkrZ ~]# ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:PL0vkEq+FSC0yMsGvUUT0LO8yfiN2p5JHkUSoN0/e04 [email protected]
The key's randomart image is:
+---[RSA 2048]----+
|  o+*.           |
| = =o+           |
|o =.*oo          |
| o +o= o .       |
|  =o o+ S..      |
| .. +..ooo .     |
|   .o=..E..      |
|   +o++=  ..     |
|  .o* ...  ..    |
+----[SHA256]-----+
[root@iZwz9938t1plpkhn7ajjkrZ ~]# 

这个是已经生成ssh的,重新生成的过程。

[root@izwz91rl2qyews1sgkymi9z ~]# ssh-keygen -t rsa -C "[email protected]"
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
/root/.ssh/id_rsa already exists.
Overwrite (y/n)? 
[root@izwz91rl2qyews1sgkymi9z ~]# 

猜你喜欢

转载自blog.csdn.net/u012881002/article/details/88140000