ssh

Secure way to run `sudo` commands in Azure Devops SSH Task

人走茶凉 提交于 2020-03-23 08:07:29
问题 I have to run few commands in Azure VM through Azure Devops release pipeline. I created SSH step and can successfully connect to remote VM. But having trouble running commands which requires sudo permissions. e.g systemctl restart <some service> errors : ##[error][sudo] password for ***: ##[error]Command failed with errors on remote machine. i tried echo <password> | sudo -S systemctl restart <some service> . No luck. What is secure way to accomplish this? 回答1: The only way to I was able to

Getting `unsupported URL protocol` when using SSH authentication with git2r::clone in R

夙愿已清 提交于 2020-03-23 07:57:49
问题 I'm trying to clone a private repo with git2r::clone via SSH (not HTTPS protocol) in R by doing git2r::clone("git@git.server.com:team_name/repo_name.git", "~/dev/") but, I keep getting Error in 'git2r_clone': unsupported URL protocol What could be wrong? I am authenticated to the repo via SSH and can clone using the same URL in the command line with git clone url . I would like to avoid using https and entering my credentials into the URL. I made sure to install libssh2 per this answer 回答1:

centos中git使用

廉价感情. 提交于 2020-03-23 04:59:18
先用root用户登录, 1 yum install git 进行安装,然后退出用普通用户登录。 1 ssh-keygen -t rsa -C "tuhooo@163.com" 登录GitHub,设置ssh keys,将~/.ssh/id_rsa.pub中的内容复制到key中 添加密钥到Github 打开 Github,登录自己的账号后 点击自己的头像->settings->SSH And GPG Keys->New SSH key 将本地 id_rsa.pub 中的内容粘贴到 Key 文本框中,随意输入一个 title(不要有中文),点击 Add Key 即可 在命令行中输入 1 ssh git@github.com 会出现如下询问: Are you sure you want to continue connecting (yes/no)? 键入yes后回车,如果出现 Hi xxx! You’ve successfully authenticated, but GitHub does not provide shell accessConnection to github.com closed. 则说明验证成功,否则可能是上述步骤中的其中几步出错了,需重新来过 1 git clone git@github.com:tuhooo/apue.git 就可以克隆了,克隆之后

Ubuntu下实现frp内网穿透(ssh+MySQL)

不打扰是莪最后的温柔 提交于 2020-03-23 01:32:15
因为一台处于服务器没有公网IP,所以打算配置下frp便于远程管理。 需要有一台处于内网的客户机,以及一个有公网IP的服务器。 frp中文文档: https://github.com/fatedier/frp/blob/master/README_zh.md 下载地址: https://github.com/fatedier/frp/releases 客户机和服务器上各一份解压。 将 frps 及 frps.ini 放到具有公网 IP 的机器上。 将 frpc 及 frpc.ini 放到处于内网环境的机器上。 服务器配置 注意如果使用云服务器的话在各家安全组将此处使用的端口(7000)以及用到的其他端口(6000、6001)放开。 修改frps.ini # frps.ini [common] bind_port = 7000 启动命令 ./frps -c ./frps.ini 推荐使用nohup启动,可后台挂起 nohup ./frps -c ./frps.ini 客户机配置 修改 frpc.ini 文件,假设 frps 所在服务器的公网 IP 为 x.x.x.x; # frpc.ini [common] server_addr = x.x.x.x server_port = 7000 [ssh] type = tcp local_ip = 127.0.0.1 local_port

使用树莓派打造一个音乐播放器

☆樱花仙子☆ 提交于 2020-03-22 20:27:34
买了个树莓派3B+,装好系统后灰落了好厚一层都不知道要干嘛。。。最近突发奇想:用树莓派做一个音乐播放器,每天6:30-7:20自动播放英语听力,强迫自己练习英语,也治治自己的懒床习惯,平时也可以用来听听歌。 准备工作: 1.树莓派一个,并且己安装好linux系统,并且己安装好Python3环境; 2.音箱一个(AUX有线接口或蓝牙音箱都行),连接到树莓派上; 软件环境搭建: mtool 是一个用python写的音乐播放器,在gitee和github上开源,主要用命令行进行控制,这个很适合我们这个需求。 下载地址: https://gitee.com/shadowlesswalker/mtool.git 首先我们在电脑上用ssh工具(我用的putty)登陆到树莓派,不会的可以另行百度树莓派ssh教程。输入以下命令: cd /usr git clone https://gitee.com/shadowlesswalker/mtool.git mtool #下载mtool源代码 cd mtool ln -s -f /usr/mtool/mtoolctl /usr/bin/mtool #创建软链接(快捷方式) 然后安装mtool依赖包:pygame,configparser(有的话就不用安装了) sudo apt install python3-pygame pip3 install

创建 VuePress + GithubPages + TravisCI 在线文档

烂漫一生 提交于 2020-03-22 14:35:25
目录 最终效果 思路 总体 过程 用到的东西 相关 创建Github仓库 创建Github仓库 SSH密钥链接Github 生成SSH密钥 Github添加SSH密钥 测试SSH密钥 配置VuePress 安装VuePress 安装yarn Debian / Ubuntu Windows 更换国内的源 安装VuePress VuePress目录结构 配置依赖和脚本 配置package.json 页面的设置 首页 文档属性 markdown扩展 默认主题设置 导航栏 侧边栏 Git仓库 其他 插件 config.js所有内容 TravisCI生成和发布 创建gh-pages分支 deploy.sh部署文件 Travis CI 部署文件 生成和使用 Token 生成Token Travis CI 绑定和配置 绑定 Github 账号 添加 Token 推送到Github 完成 最新博客链接 VuePress 在线文档链接_Github Pages VuePress 在线文档链接_博客服务器 (如果上面进不去,可以进这个,服务器在阿里云) Github链接 最终效果 最终效果链接 思路 总体 VuePress 在本地完成项目的源文件,推送至 Github 触发 Travis CI 自动构建目标文件,完成后自动部署到另一个 Github 分支,此分支作在线文档使用。

上传本地文件到github

我与影子孤独终老i 提交于 2020-03-22 01:30:46
1. github在线上传文件夹 在线上传也可以上传完整的文件夹结构,直接拖拽到上传文件页面的框中即可。 1.1点击上传文件 点击上传 1.2 直接拖拽 直接拖拽即可上传文件夹及文件夹里面的文件。如果点击 choose your files 就只能上传单个文件。 直接拖拽 2. 通过git工具上传本地文件夹(本地项目) 2.1 下载 git工具 选择对应版本下载 2.2 下载完成后安装完成,注意在安装过程中可以选择创建桌面快捷方式 2.3 绑定用户 打开git-bash.exe(直接在桌面上点击右键,或者点击开始按钮找到Git Bash) 在打开的GIt Bash中输入以下命令(用户和邮箱为你github注册的账号和邮箱) $ git config --global user.name "hankleo" $ git config --global user.email "hankleo@outlook.com" 2.4 设置SSH key( git中sshkey有何作用? ) 2.4.1 生成ssh key 首先检查是否已生成密钥 cd ~/.ssh ,如果返回的ls有3个文件,则密钥已经生成。 密钥生成 如果没有密钥,则通过 $ ssh-keygen -t rsa -C "hanleo@outlook.com" 生成,生成过程中一路按3次回车键就好了。(默认路径

Get Live logs in front end on rails application

故事扮演 提交于 2020-03-21 16:01:56
问题 Here in the rails 3.x app,I am using net::ssh and running some commands to remote pc.I would like to display the live logs to the user's browser.like,If two commands are running in net::ssh to execute i.e echo "Hello" , echo "Bye" is passed then "Hello" should be displayed in the browser immediately finishing after its execution.Here is the code I am using for ssh connection and running commands in ruby on rails application Net::SSH.start( @servers['local'] , @machine_name, :password =>

Get Live logs in front end on rails application

丶灬走出姿态 提交于 2020-03-21 16:01:02
问题 Here in the rails 3.x app,I am using net::ssh and running some commands to remote pc.I would like to display the live logs to the user's browser.like,If two commands are running in net::ssh to execute i.e echo "Hello" , echo "Bye" is passed then "Hello" should be displayed in the browser immediately finishing after its execution.Here is the code I am using for ssh connection and running commands in ruby on rails application Net::SSH.start( @servers['local'] , @machine_name, :password =>

SSH框架的简单示例(执行流程)

半腔热情 提交于 2020-03-21 13:26:57
本文转自一篇博文,感觉通俗易懂,适用于初学j2ee者,与大家一起分享 (一)struts框架部分 1.打开Myeclipse,创建一个web project,项目名称为TestSSH. 2.在web的lib下粘贴struts需要的六个jar包.(jar包在附件里) 3.在web下的web.xml中配置struts的filter. 代码如下: <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"> //上面几行代码是从Referenced Libraies下的struts-core-2.0.8.jar下的struts-default.xml中拷贝过来的 <!-- 配置struts开始 --> <filter> <filter-name>myStruts</filter-name> <!--这个过滤器的名字可以随便写-->