ssh

xshell连接Ubuntu宝典

六眼飞鱼酱① 提交于 2020-01-30 09:57:10
首先你要有一个xshell和一个装有ubuntu系统的虚拟机或者真实的主机。 Ubuntu默认不安装openssh服务器,所以若要使用ssh远程登录Ubuntu主机,首先需要安装ssh服务器。 首先,判断Ubuntu是否安装了ssh服务: 1、输入:#ps -e | grep ssh 如果服务已经启动,则可以看到“sshd”,否则表示没有安装服务,或没有开机启动 2、安装ssh服务,输入命令:#sudo apt-get install openssh-server 3、启动服务:#/etc/init.d/ssh start 4、本机测试是否能够成功登录:#ssh -l 用户名 本机ip 5、用远程工具进行远程连接,若拒接访问,则关闭防火墙或允许22端口。 一般完成上面的步骤就可以连上了。 桥接模式可以使路由器使用DHCP的方式分配IP,如果你的电脑所处的网络拓扑中没有路由器的话也是ping不通的。如果有路由器,因为防火墙导致无法连接,可以使用 sudo ufw disabled 命令禁用防火墙。 或者在防火墙开启的情况下开放22端口命令是 sudo ufw allow 22 来源: https://www.cnblogs.com/tjyo/p/5992065.html

centos 7.3 快速安装ceph

随声附和 提交于 2020-01-30 09:34:54
Ceph简介 Ceph是一种为优秀的性能、可靠性和可扩展性而设计的统一的、 分布式文件系统 。 部署逻辑架构 准备3台主机,并且修改主机名(hostnamectl set-hostname xxx 后重启) IP地址 主机名(Hostname) 192.168.1.24 node1(用该主机同时作为管理和监控节点) 192.168.1.25 node2 (osd.0 节点) 192.168.1.26 node3 (osd.1 节点) 在各节点上安装启用软件仓库,启用可选软件库 # sudo yum install -y yum-utils && sudo yum-config-manager --add-repo https://dl.fedoraproject.org/pub/epel/7/x86_64/ && sudo yum install --nogpgcheck -y epel-release && sudo rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 && sudo rm /etc/yum.repos.d/dl.fedoraproject.org* # sudo yum install yum-plugin-priorities 修改node1节点/etc/hosts文件,增加以下内容: 192.168.1.24

1.SSH协议学习笔记

烈酒焚心 提交于 2020-01-30 08:55:38
一、SSH介绍 介绍: SSH全称是 Secure Shell ,安全外壳协议。 端口号:22; 如何查看服务端口号: grep ssh /etc/services netstat -antup | grep ssh lsof -i:22 作用:sshd服务使用SSH协议可以用来进行远程控制, 或在计算机之间传送文件。 验证方式:1、基于口令 2、基于密钥安全验证(后文将结合expect详细介绍SSH免密登录及批量配置管理) telnet使用明文传输,ssh加密传输 二、SSH服务安装 1、需要安装OpenSSH 四个安装包: openssh-5.3p1-114.el6_7.x86_64: 包含OpenSSH服务器及客户端需要的核心文件 openssh-clients-5.3p1-114.el6_7.x86_64: OpenSSH客户端软件包 openssh-server-5.3p1-114.el6_7.x86_64: OpenSSH服务器软件包 openssh-askpass-5.3p1-114.el6_7.x86_64: 支持对话框窗口的显示,是一个基于X 系统的密码 诊断工具 2、 两种安装方式 yum install openssh openssh-clients openssh-server -y rpm –ivh /media/cdrom/Packages

Ceph 存储集群 - 搭建存储集群

橙三吉。 提交于 2020-01-30 07:46:49
目录 一、准备机器 二、ceph节点安装 三、搭建集群 四、扩展集群(扩容) 一、准备机器 本文描述如何在 CentOS 7 下搭建 Ceph 存储集群(STORAGE CLUSTER)。 一共4台机器,其中1个是管理节点,其他3个是ceph节点: hostname ip role 描述 admin-node 192.168.0.130 ceph-deploy 管理节点 node1 192.168.0.131 mon.node1 ceph节点,监控节点 node2 192.168.0.132 osd.0 ceph节点,OSD节点 node3 192.168.0.133 osd.1 ceph节点,OSD节点 管理节点:admin-node ceph节点:node1, node2, node3 所有节点:admin-node, node1, node2, node3 1. 修改主机名 # vi /etc/hostname 2. 修改hosts文件 # vi /etc/hosts 192.168.0.130 admin-node 192.168.0.131 node1 192.168.0.132 node2 192.168.0.133 node3 3. 确保联通性(管理节点) 用 ping 短主机名( hostname -s )的方式确认网络联通性。解决掉可能存在的主机名解析问题。 $

拉取远程仓库到本地错误The authenticity of host 'github.com (13.229.188.59)' can't be established.

☆樱花仙子☆ 提交于 2020-01-30 06:12:13
1、个人在github上面创建了仓库,通过本地的git拉取远程仓库到本地报错信息如下: 这是因为Git使用SSH连接,而SSH第一次连接需要验证GitHub服务器的Key。确认GitHub的Key的指纹信息是否真的来自GitHub的服务器。解决办法。其实就是在本地生成key配置到github服务器。这样子接收过来就gitHub服务器了。 2、使用命令: ls -al ~/.ssh 3、使用命令: ssh-keygen -t rsa -C “github用户名”,按三次回车 4、查看生成的key:cat ~/.ssh/id_rsa.pub 5、登陆github,点击头像-settings-new SSH,复制新生成的SSH配置到服务器,记住拷贝是4步骤下面的秘钥信息以ssh-rsa开始邮箱结束的。 6、正常克隆跟同步代码到github。完美解决 原文链接:https://www.cnblogs.com/yuanchaoyong/p/9976895.html 来源: CSDN 作者: yzpfyang 链接: https://blog.csdn.net/csdn_pfyang/article/details/104108438

ssh to remote machine with password in script via python

馋奶兔 提交于 2020-01-30 05:56:28
问题 I am working with remote machine. I had to ssh everytime i need verification of file update time and there are multiple scripts which will do ssh to the remote machine. I look over internet but couldn't find according to my requirements. I am trying to find a python script which uses ssh and the password is also in the script because my python scripts will check every 5 minutes the file modification times and i cannot enter password everytime the script execute. I tried these codes from SO

How to execute a scp command before reboot or shutdown?

跟風遠走 提交于 2020-01-30 04:27:56
问题 I want to upload file before reboot or shutdown. 1.From my vps to vps Setting for upload.service vim /etc/systemd/system/upload.service [Unit] Description=upload files into my vps Before=shutdown.target reboot.target Requires=network-online.target After=network.target [Service] ExecStart=/bin/true ExecStop=/bin/bash /home/upload.sh [Install] WantedBy=multi-user.target Script for upload.sh vim /home/upload.sh /usr/bin/scp -P 22 -i /home/.ssh/id_rsa /home/wp.bak root@remote_ip:/home It is time

How to execute a scp command before reboot or shutdown?

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-30 04:27:31
问题 I want to upload file before reboot or shutdown. 1.From my vps to vps Setting for upload.service vim /etc/systemd/system/upload.service [Unit] Description=upload files into my vps Before=shutdown.target reboot.target Requires=network-online.target After=network.target [Service] ExecStart=/bin/true ExecStop=/bin/bash /home/upload.sh [Install] WantedBy=multi-user.target Script for upload.sh vim /home/upload.sh /usr/bin/scp -P 22 -i /home/.ssh/id_rsa /home/wp.bak root@remote_ip:/home It is time

How to connect and access Google Cloud Compute Engine VM via Python 3.6

懵懂的女人 提交于 2020-01-30 04:04:51
问题 I want to access the Google Cloud Compute Engine VM using Python 3.6 and I need to perform normal CLI actions like remote machine. I am able to login to the VM instance via gcloud command, which is produced in VM instance's page manually, and I am able to use googleapiclient.discovery Python module to do some operations like list instances, create instances and delete instances. But, I am not able to login to the VM instance and access, e.g. like remote machine via Python. Please direct me to

git分布式版本控制系统

和自甴很熟 提交于 2020-01-30 01:44:54
特点 分布式版本控制(成员的计算机上都有完整的版本库) 多人协调工作(强大的分支能力) 有效监听谁做的修改(提交、合并是添加信息) 本地及远程操作(个人计算机和公共服务器) 使用前的设置 git --version                // 查看当前git版本 git config --global user.name ‘your name’    // 全局设置自己的名字 git config --global user.email ‘email’     // 全局设置自己的邮箱名字 ssh-keygen -t rsa -C " your email "      // 创建SSK Key 常用命令 创建新的本地储存库 git init // 创建新的本地存储库   添加 git add <file>   // 添加文件 git add .     // 添加所有文件   提交 git commit -m ‘notes’   // 提交并添加注释   撤销 git checkout -- <file>     // 拉取暂存区的文件替换工作区的文件 git reset HEAD <file>      // 拉取版本库的文件替换暂存区的文件 git reset -- hard commit_id    // 版本切换   查看 git diff <file>   //