github连接被拒绝的问题

版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/jt120/article/details/18505067

1、根据网上的教程,生成ssh key,并在自己的github中设置key,测试结果显示没有权限,如下:

ssh-keygen -t rsa -C "name@mail.com"

然后复制key到github,查看是否成功

ssh -vT git@github.com

发现以下错误:

Permission denied (publickey).

2、问题其实可以参考回显:

debug1: identity file /.ssh/id_rsa type -1
debug1: identity file /.ssh/id_dsa type -1

原因就是你生成的key在.ssh这个路径下找不到,那么是哪个路径了,搜索发现,是git安装路径下,所以把你生成的文件,复制过去,就ok了


生成的key在什么路径?

输入ssh-keygen -t rsa -C "name@mail.com",第一个参数可以选择生成路径,密码就不生成了,一路回车

Enter file in which to save the key (//.ssh/id_rsa): c:/test/id_rsa


修改git用户名和邮箱

git config --global user.name yourname

git config --global user.email youremail

展开阅读全文

Socket连接拒绝

08-29

我在本地建立一个Socket服务端和客户端。先启动的服务端,正常启动,客户端启动时报错:java.net.ConnectException: Connection refused: connect,连接被拒绝,我的防火墙已经关闭了啊。到底是什么问题呢。rncilent:rnpackage ss;rnimport java.io.BufferedReader;rnimport java.io.IOException;rnimport java.io.InputStreamReader;rnimport java.io.PrintWriter;rnimport java.net.InetAddress;rnimport java.net.Socket;rnimport java.net.UnknownHostException;rnrnpublic class aa rn Socket client; rn PrintWriter pw; rn rn public aa() throws UnknownHostException, IOException rn client=new Socket(InetAddress.getLocalHost(),7777); rn pw=new PrintWriter(client.getOutputStream()); rn BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); rn pw.write(br.readLine()); rn pw.close(); rn br.close(); rn rn public static void main(String[] args) rn try rn new aa(); rn catch (UnknownHostException e) rn e.printStackTrace(); rn catch (IOException e) rn e.printStackTrace(); rn rn rn rnrnrn服务端:rnpackage ss;rnrnimport java.io.BufferedReader;rnimport java.io.IOException;rnimport java.io.InputStreamReader;rnimport java.net.ServerSocket;rnimport java.net.Socket;rnrnimport test.Server;rnrnpublic class serrn private Socket socket; rnprivate ServerSocket ss; rnrnpublic ser() throws IOException rn ss = new ServerSocket(7777); rn while (true) rn socket = ss.accept(); rn BufferedReader br = new BufferedReader(new InputStreamReader(socket rn .getInputStream())); rn System.out.println("you input is : " + br.readLine()); rn rn rnrnpublic static void main(String[] args) rn try rn new Server(); rn catch (Exception e) rn e.printStackTrace(); rn rn rnrn 问答

没有更多推荐了,返回首页