小编Sch*_*ern的帖子

使用 PuTTYgen 了解 SSH 私钥和公钥

我使用 PuTTy 密钥生成器创建了一个公钥。我将公钥复制到david.pub并发送给将密钥放在服务器(vps)上的开发人员,以便我可以克隆存储库。当我创建公钥时,我输入了一个密码。当我尝试克隆时,会发生这种情况:

$ git clone my_app:money_app.git new_money_app Cloning into 'new_money_app'... Enter passphrase for key '/c/Users/User1/.ssh/david.pub':

我输入我设置的密码,这行重复了 3 次 Enter passphrase for key '/c/Users/User1/.ssh/david.pub':

然后显示后

 Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

存储库存在。这是我的配置文件的外观:

Host my_app
User git
HostName xx.xx.xxx.xx
PubkeyAuthentication yes
PreferredAuthentications publickey
IdentityFile ~/.ssh/david.pub
Run Code Online (Sandbox Code Playgroud)

我如何解决这个问题,以便我可以克隆存储库?我对 GIT 完全陌生,是否需要重新创建公钥?我被告知要创建一个公钥,我还需要一个私钥吗?

我是前端开发人员,所以这很令人困惑。

ssh putty ssh-keys

0
推荐指数
1
解决办法
387
查看次数

为什么我的 golang 模板没有选择外部 javascript 文件?

我从堆栈溢出中尝试了很多建议,但似乎都没有奏效。我无法选择外部 js 文件。

我的主要功能:

package main

import(
    "encoding/json"
    "net/http"
    "fmt"
    "github.com/gorilla/mux"
    "github.com/rs/cors"
    "text/template"
)  

func GetPeopleEndpoint(w http.ResponseWriter, req *http.Request) {
    w.Header().Set("Content-Type", "text/html")
    t, _ := template.ParseFiles("index2.html")
    t.Execute(w, nil)
}

func main() {
    router := mux.NewRouter()
    people = append(people, Person{ID: "1", Firstname: "Nic", Lastname: "Raboy", Address: &Address{City: "Dublin", State: "CA"}})
    people = append(people, Person{ID: "2", Firstname: "Maria", Lastname: "Raboy"})

    fmt.Println(people)

    router.Handle("/files/", http.StripPrefix("/files/", http.FileServer(http.Dir("."))))
    router.HandleFunc("/people", GetPeopleEndpoint)

    c := cors.New(cors.Options{
        AllowedOrigins: []string{"http://localhost:3000"},
        AllowCredentials: true,
    })

    // Insert the middleware
    handler := c.Handler(router)

    // …
Run Code Online (Sandbox Code Playgroud)

go

0
推荐指数
1
解决办法
1121
查看次数

基于键值从现有散列创建一个新数组

[{"date"=>"2020-09-15", "work_category"=>"CASE PICKS", "count"=>"21315"},
 {"date"=>"2020-09-15", "work_category"=>"LOADING", "count"=>"6401"},
 {"date"=>"2020-09-15", "work_category"=>"PALLET STAGING", "count"=>"6649"},
 {"date"=>"2020-09-15", "work_category"=>"PUTAWAY", "count"=>"4974"},
 {"date"=>"2020-09-15", "work_category"=>"RECEIVING", "count"=>"4108"},
 {"date"=>"2020-09-16", "work_category"=>"CASE PICKS", "count"=>"16842"},
 {"date"=>"2020-09-16", "work_category"=>"LOADING", "count"=>"4987"},
 {"date"=>"2020-09-16", "work_category"=>"PALLET STAGING", "count"=>"5716"},
 {"date"=>"2020-09-16", "work_category"=>"PUTAWAY", "count"=>"6292"},
 {"date"=>"2020-09-16", "work_category"=>"RECEIVING", "count"=>"4894"},
 {"date"=>"2020-09-17", "work_category"=>"CASE PICKS", "count"=>"24849"},
 {"date"=>"2020-09-17", "work_category"=>"LOADING", "count"=>"5303"},
 {"date"=>"2020-09-17", "work_category"=>"PALLET STAGING", "count"=>"5753"},
 {"date"=>"2020-09-17", "work_category"=>"PUTAWAY", "count"=>"5136"},
 {"date"=>"2020-09-17", "work_category"=>"RECEIVING", "count"=>"4699"},
 {"date"=>"2020-09-18", "work_category"=>"CASE PICKS", "count"=>"11806"},
 {"date"=>"2020-09-18", "work_category"=>"LOADING", "count"=>"5147"},
 {"date"=>"2020-09-18", "work_category"=>"PALLET STAGING", "count"=>"5426"},
 {"date"=>"2020-09-18", "work_category"=>"PUTAWAY", "count"=>"5110"},
 {"date"=>"2020-09-18", "work_category"=>"RECEIVING", "count"=>"4534"},
 {"date"=>"2020-09-19", "work_category"=>"CASE PICKS", "count"=>"8086"},
 {"date"=>"2020-09-19", "work_category"=>"LOADING", "count"=>"1753"},
 {"date"=>"2020-09-19", "work_category"=>"PALLET STAGING", "count"=>"2201"},
 {"date"=>"2020-09-19", …
Run Code Online (Sandbox Code Playgroud)

ruby hash dictionary

0
推荐指数
1
解决办法
52
查看次数

VisualStudio 说 GitHub 存储库已经存在,但 Github 说不存在

我正在尝试通过 Visual Studio Code 创建一个新的 GitHub 存储库,但是当我创建它时收到以下消息: 强文本

但实际上我没有名为“INF256-Tarea-1”的存储库(公共或私人),如您在此处看到的: 在此输入图像描述

Git 输出是这样说的:

Looking for git in: C:\Program Files\Git\cmd\git.exe
Using git 2.27.0.windows.1 from C:\Program Files\Git\cmd\git.exe
> git rev-parse --git-dir
Open repository: c:\Users\lilkimo\Desktop\Universidad\INF256\INF256-Tarea-1
> git fetch
> git status -z -u
> git symbolic-ref --short HEAD
> git rev-parse master
> git rev-parse --symbolic-full-name master@{u}
fatal: no upstream configured for branch 'master'
> git for-each-ref --sort -committerdate --format %(refname) %(objectname)
> git remote --verbose
> git check-ignore -v -z --stdin
> git config --get …
Run Code Online (Sandbox Code Playgroud)

github visual-studio-code

0
推荐指数
1
解决办法
5892
查看次数

如何实现类实例的 get 方法,同时仍然可以访问 Ruby 中的对象方法?

我需要将类的实例写入变量,并能够访问它以获取其值并访问其方法。我可以以某种方式实现这个吗?

例如:

class A
  def initialize(value)
    @value = value
  end

  def preview
    puts "Class preview: #{@value}"
  end

  def something(param)
    puts "Something method: #{@value * param}"
  end
end

class B
  attr_reader :obj

  def set_object(obj)
    @obj = obj
  end
end

b = B.new
b.set_object(A.new(5))

b.obj # ==> 5
10 + b.obj # ==> 15

b.obj.preview # ==> "Class preview: 5"
b.obj.something(3) # ==> "Something method: 15"
Run Code Online (Sandbox Code Playgroud)

ruby

0
推荐指数
1
解决办法
63
查看次数

标签 统计

ruby ×2

dictionary ×1

github ×1

go ×1

hash ×1

putty ×1

ssh ×1

ssh-keys ×1

visual-studio-code ×1