Linux中shell脚本中SCP命令免密远程复制

发布时间:2024-02-26 16:08:29   分类:liunx & centos&nginx

使用密钥文件,两台机器建立信任这里假设主机A(192.168.100.3)用来获得主机B(192.168.100.4)的文件。在主机A上执行如下命令来生成配对密钥:ssh-keygen -t rsa遇到提示回车默认即可,公钥被存到用户目录下.ssh目录,比如root存放在:/root/.ssh/id_rsa.pub将 .ssh 目录中的 id_rsa.pub 文件复制到 主机B 的 ~/.ssh/ 目录中,并改名为 authorized_keys,到主机A中执行命令和主机B建立信任,例(假设主机B的IP为:192.168.100.4):scp ~/.ssh/id_rsa.pub 192.168.100.4:/ro

查看服务器的外网IP

发布时间:2023-12-29 14:01:23   分类:liunx & centos&nginx

查看服务器的外网IP1、curl cip.cc[test@rabbitmq02 ~]$ curl cip.cc IP : 220.168.33.22 地址 : 中国  湖南  长沙 运营商 : 电信 数据二 : 湖南省长沙市 | 电信 数据三 :  URL : http://www.cip.cc/220.168.33.222、curl myip.ipip.net[test@rabbitmq02 ~]$ curl myip.ipip.net 当前&nb

Linux编译安装NGINX,及ssl未配置增加

发布时间:2023-10-31 15:38:37   分类:liunx & centos&nginx

1、安装编译工具及库文件yum -y install make zlib zlib-devel gcc-c++ libtool  openssl openssl-devel pcre-devel2、下载所需文件 https://nginx.org/en/download.html 选择相应版本3、解压,编译     创建nginx 目录 /usr/local/nginx 最后编译完成的位置     解压 tar -zxvf nginx-1.24.0.tar.gz     进入解压目录    &n

在Linux环境下安装Nodejs

发布时间:2023-10-31 14:54:00   分类:liunx & centos&nginx

下载nodejs版本安装包wget https://nodejs.org/dist/v14.15.1/node-v14.15.1-linux-x64.tar.xz# tar -xf node-v16.16.0-linux-x64.tar.gz配置环境变量编辑环境变量 # vim /etc/profile 在文件最后加上两行:   /root/nodejs 文件解压目录   export NODEJS_HOME=/root/nodejs   export PATH=$NODEJS_HOME

linux下安装ffmpeg

发布时间:2022-12-23 10:16:46   分类:liunx & centos&nginx

ffmpeg 可以获取视频文件相关信息 比如视频时间长    ffmpeg -i 文件地址 2>&1 | grep 'Duration' | cut -d ' ' -f 4 | sed s/,//返回格式 00:01:37.77一、centos linux下安装ffmpeg1、下载解压wget http://www.ffmpeg.org/releases/ffmpeg-3.1.tar.gztar -zxvf ffmpeg-3.1.tar.gz 2、 进入解压后目录,输入如下命令/usr/local/ffmpeg为自己指定的安装目录cd ffmpeg-3.1.

Nginx方向代理多个地址

发布时间:2022-12-22 10:35:22   分类:liunx & centos&nginx

如下是一个错误的配置:location /proxyname/ {       proxy_pass https://www.xxxxxxx.com; }如下是一个正确的配置:location ^~ /proxyname/ {       proxy_pass https://www.xxxxxxx.com/; }以上有两处不同的地方:1、“ ^~ ” 开头这个意思是强制匹配,原因是这样优先级高,不要被其他匹配规则覆盖;2、“/” 结尾在URL处,表示反向代

Linux OpenSSH-升级 9.0

发布时间:2022-12-21 15:17:17   分类:liunx & centos&nginx

1、下载安装包    Zlib官网:http://www.zlib.net/   官网下载     OpenSSL官网:https://www.openssl.org/     github https://github.com/openssl/openssl/tags    OpenSSH官网:https://www.openssh.com/    aliyun https://mirrors.aliyun.com/openssh/portable/ 2、开启 telnet

sshd启动故障“Failed to start OpenSSH Server daemon ”解决方法

发布时间:2022-12-21 14:47:57   分类:liunx & centos&nginx

使用 sshd -t  根据输出结果的错误处理 

Nginx 上传大文件报跨域错误

发布时间:2021-07-09 11:55:39   分类:liunx & centos&nginx

NGINX 上传大文件报跨域   原因 是上传大文件接超时导致NGINX修改超时配置http{ #读取http头部的超时时间,单位秒,连接建立后,服务端接收http头部,规定时间内没收到,则超时,返回给客服端408(request time out) client_header_timeout 60; #读取http body的超时时间,单位秒,连接建立后,服务端接收body,规定时间内没收到,则超时,返回给客服端408(request time out) client_body_timeout 60; #发送响应超时时间,单位秒,服务端向客户端发送数据包,规定时间内客户端没收到,则超时 send_timeout 60; #保持闲置

nginx vue 前端POST请求405问题解决

发布时间:2021-04-25 15:33:21   分类:liunx & centos&nginx

前端vue NGINX代理,访问go接口405,查看Vue代理的地址和NGINX的转发地址是否嫩对应上: {     [..]: { : : : { [+ ..]: }     } }location /api/ {   proxy_set_header X-Forwarded-Proto $scheme;   proxy_set_header X-Forwarded-Port