查看本机的出口公网IP信息:
curl ifconfig.me
或者:
curl cip.cc
今天遇到github的仓库克隆不下来,报错如下:
fatal: unable to access 'https://github.com/fisher-yu/golang.git/': SSL connect error
过完年回来, github不安分了, 发现博文说不支持TLSv1/TLSv1.1: Weak cryptographic standards removed, 没看到这篇博文之前, 还以为是代理问题, 设置过, 还是不行, 还更新到最新的git, 还是不行, 就查了一下TLS协议, 终于通过git的文档中获得提示: git配置文档.
首先, 更新git, 我也没查过要更新到什么版本, 反正之前用1.8有问题, 接下来的操作都不起效, 换了2.16以后才可以, 有条件就更到最新呗. 至于怎么更新, 自己查资料, 我就不喜欢惯着你们. PS:OpenSSL和libcurl可能也要升级
然后就开始设置了, 就一行命令
git config --global http.sslversion tlsv1
理论上来说, 应该是不支持TLSv1的, 但设置成tlsv1才行, 其他的tlsv1.2什么的都不行, 我也不知道啊, 求指教, 求科普
#!/bin/bash # # Startup script for Nginx - this script starts and stops the nginx daemon # # chkconfig: - 85 15 # description: Nginx is an HTTP(S) server, HTTP(S) reverse proxy and IMAP/POP3 proxy server # processname: nginx # config: /usr/local/nginx/conf/nginx.conf # pidfile: /usr/local/nginx/logs/nginx.pid # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network # Check that networking is up. [ "$NETWORKING" = "no" ] && exit 0 nginx="/usr/local/nginx/sbin/nginx" prog=$(basename $nginx) NGINX_CONF_FILE="/usr/local/nginx/conf/nginx.conf" [ -f /etc/sysconfig/nginx ] && . /etc/sysconfig/nginx lockfile=/var/lock/subsys/nginx start() { [ -x $nginx ] || exit 5 [ -f $NGINX_CONF_FILE ] || exit 6 echo -n $"Starting $prog: " daemon $nginx -c $NGINX_CONF_FILE retval=$? echo [ $retval -eq 0 ] && touch $lockfile return $retval } stop() { echo -n $"Stopping $prog: " killproc $prog -QUIT retval=$? echo [ $retval -eq 0 ] && rm -f $lockfile return $retval } restart() { configtest || return $? stop sleep 1 start } reload() { configtest || return $? echo -n $"Reloading $prog: " killproc $nginx -HUP RETVAL=$? echo } force_reload() { restart } configtest() { $nginx -t -c $NGINX_CONF_FILE } rh_status() { status $prog } rh_status_q() { rh_status >/dev/null 2>&1 } case "$1" in start) rh_status_q && exit 0 $1 ;; stop) rh_status_q || exit 0 $1 ;; restart|configtest) $1 ;; reload) rh_status_q || exit 7 $1 ;; force-reload) force_reload ;; status) rh_status ;; condrestart|try-restart) rh_status_q || exit 0 ;; *) echo $"Usage: $0 {start|stop|status|restart|condrestart|try-restart|reload|force-reload|configtest}" exit 2 esac
widonws上用xshell生成用户秘钥免密码登录linux服务器,具体方法如下图:
注:这里给私钥起个名字,为了方便记忆可以以服务器的IP地址做文件名,点击Next。
groupadd www useradd -r -g www -d /home/www -m www -s /bin/bash #为用户设置密码 passwd www
-r 创建系统用户
-g 加入用户组
-d 用户的家目录
-m 自动建立用户的登入目录
-s 指定用户登入后所使用的shell
如果想其他普通用户切换到www无需密码,则可以修改/etc/passwd下的www用的x去掉
mysql:x:995:1000::/home/mysql:/bin/bash
www::994:1001::/home/www:/bin/bash