shell中copy_pubkey.sh非全自动脚本的示例分析
发表于:2024-09-22 作者:千家信息网编辑
千家信息网最后更新 2024年09月22日,这篇文章给大家分享的是有关shell中copy_pubkey.sh非全自动脚本的示例分析的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。#!/bin/bashprivkey=
千家信息网最后更新 2024年09月22日shell中copy_pubkey.sh非全自动脚本的示例分析
这篇文章给大家分享的是有关shell中copy_pubkey.sh非全自动脚本的示例分析的内容。小编觉得挺实用的,因此分享给大家做个参考,一起跟随小编过来看看吧。
#!/bin/bashprivkey="$HOME/.ssh/id_rsa"publickey="$HOME/.ssh/id_rsa.pub"# Usage helpif [ $# -ne 1 ];then echo "Usage:$0 [user@]hostname" exit 1fi# test private/publick key exist or not, and the privilege 600 or notif [ -f "$privkey" -a -f "$publickey" ];then privkey_priv=`stat -c %a $privkey` if [ "$privkey_priv" -ne 600 ];then echo "The privilege of private key ~/.ssh/id_rsa is not 600, exit now." exit 1 fielse echo "private/public key is not exist, it will create it" ssh-keygen -t rsa -f $privkey -N '' echo "keys created over, it located on $HOME/.ssh/"fissh-copy-id -o StrictHostKeyChecking=no $1if [ $? -eq 0 ];then echo -e "\e[1;32m publickey copy over \e[0m"else echo -e "\e[1;31mssh can't to the remote host\e[0m" exit 1fi
感谢各位的阅读!关于"shell中copy_pubkey.sh非全自动脚本的示例分析"这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,让大家可以学到更多知识,如果觉得文章不错,可以把它分享出去让更多的人看到吧!
全自动
示例
脚本
分析
内容
更多
篇文章
不错
实用
文章
看吧
知识
参考
帮助
有关
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
出台涉及网络安全的规范性文件
金蝶怎么查看服务器地址
数据库中的查询类型修改
网络安全大赛吴白冠军
金蝶数据库安装
数据库启动job
frm数据库版本
数据库主备同步方式
易语言数据库 索引
网络技术应用说课
软件开发的项目周期
2021黑客文化与网络安全答案
网络安全周 金融日
mysql数据库表复制
珠海飞企互联网科技公司韩恒
小程序提取数据库
兼职软件开发员工资个税
有服务器还用电脑主机吗
中职考高级软件开发工程师
圆周率服务器
保护网络安全课
mvc5中获取数据从数据库
网络文件上传服务器
电子商务高科技互联网技术
网络安全有趣的标语
软件开发在哪个网站上找工作
软件开发中uml的作用
导致数据库无法拼接的原因
计算机三级网络技术难考吗
软件开发安全管控平台