这是我第一次访问github并且我没有使用控制台.我在Macbook上(使用Bash).当我尝试访问github时,我得到了这个:
git clone git@github.com:dhulihan/league-of-legends-data-scraper.git
Cloning into 'league-of-legends-data-scraper'...
Permission denied (publickey).
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)
我已经尝试按照Github页面上关于权限被拒绝的说明 当我使用ssh -vT git@github.com时,我得到以下内容:
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to github.com [192.30.252.129] port 22.
debug1: Connection established.
debug1: identity file /Users/XXXX/.ssh/id_rsa type -1
debug1: identity file /Users/XXXX/.ssh/id_rsa-cert type -1
debug1: identity file /Users/XXXX/.ssh/id_dsa …Run Code Online (Sandbox Code Playgroud) 所以我通常会运行这个命令:
ssh -L 5901:myUser@computer.myHost.edu:5901
我用它来通过SSH做VNC.
如何将该命令转换为可在〜/ .ssh/config文件中使用的命令?
例如:
host yam
HostName yam.myHost.edu
User myUserName
Run Code Online (Sandbox Code Playgroud)
我想做的就是输入:
ssh yam
Run Code Online (Sandbox Code Playgroud)
并让它打开一个带有本地监听端口的SSH shell,并转发一个远程端口.
建议?
我目前在服务器上上传了一个旧的SSH密钥.问题是我丢失了我的~/.ssh目录(原始文件id_rsa和id_rsa.pub文件).
因此,我想直接在服务器上删除旧的SSH密钥并上传新的密钥.
我尝试了以下命令但没有成功:
$> ssh-add -D
Run Code Online (Sandbox Code Playgroud)

有没有办法完全删除SSH密钥?
如何通过shell脚本执行SQL命令,以便我可以使其自动化?
我想使用shell脚本恢复我在SQL文件中收集的数据.我想连接到服务器并恢复数据.该命令在通过SSH命令行单独执行时有效.
这是我使用的命令:
mysql -h "server-name" -u root "password" "database-name" < "filename.sql"
Run Code Online (Sandbox Code Playgroud)
这是创建文件ds_fbids.sql并将其传递到mysql 的shell脚本代码.
perl fb_apps_frm_fb.pl
perl fb_new_spider.pl ds_fbids.txt ds_fbids.sql
mysql -h dbservername -u username -ppassword dbname < ds_fbids.sql
Run Code Online (Sandbox Code Playgroud)
这样做的正确方法是什么?
我正在编写一个脚本来自动化Python中的一些命令行命令.此刻我正在打电话:
cmd = "some unix command"
retcode = subprocess.call(cmd,shell=True)
Run Code Online (Sandbox Code Playgroud)
但是我需要在远程计算机上运行一些命令.手动,我会使用ssh登录然后运行命令.我如何在Python中自动执行此操作?我需要使用(已知的)密码登录到远程机器,所以我不能只使用cmd = ssh user@remotehost,我想知道是否有一个我应该使用的模块?
我正在尝试使用Raspberry Pi建立VPN,第一步是ssh从本地网络外部获取进入设备的能力.无论出于何种原因,这被证明是不可能的,我没有丝毫的线索.当我尝试ssh进入我的服务器时user@hostname,我收到错误:
ssh: Could not resolve hostname [hostname]: nodename nor servname provided, or not known
Run Code Online (Sandbox Code Playgroud)
但是,我可以登录到服务器,
ssh user@[local IP]
Run Code Online (Sandbox Code Playgroud)
服务器是Raspberry Pi Model B运行Raspbian的最新发行版,而我正在尝试连接它的机器是运行Mavericks的Macbook Pro.ssh我设置Raspbian时在Raspberry Pi上启用了.
我已经仔细阅读了Stack Overflow几个小时,试图看看是否有其他人遇到过这个问题而且我还没有找到任何东西.ssh我找到的每个教程都说我应该能够在远程计算机上进行设置,并使用主机名从任何地方登录,而且我从未取得过成功.
我想在Emacs中打开一个文件,该文件位于远程服务器上,服务器上有sudo power.我可以通过Tramp打开sudo本地文件,如下所示:
C-x C-f /sudo::/home/user/file
Run Code Online (Sandbox Code Playgroud)
但是我想在服务器上使用sudo:
C-x C-f /sudo::user@server/home/user/file
Run Code Online (Sandbox Code Playgroud)
但这给了我本地机器上的sudo权限,它在本地机器上询问我的sudo密码.有没有办法在服务器上使用sudo?
顺便说一句:服务器上没有安装Emacs
有没有办法将PEM文件转换为PPK文件?(你可能猜到Amazon EC2给了我一个PEM文件,我需要使用PPK格式进行SSH连接).
我试过谷歌搜索并阅读http://help.github.com/troubleshooting-ssh/和各种各样的指南.我无法git push -u origin master或git push origin master(同一命令).
我的git帐户至少有2年左右的时间.我已经成功地push -u origin master在我的笔记本电脑上创建了回购和罚款,但在这个桌面上我遇到了问题.
这是我试过的:
1.我已经设置了我的git用户名
2.我已经设置了我的git用户电子邮件
3.我已将/home/meder/.ssh/id_rsa.pub的内容上传到github的帐户页面.我已经验证我没有粘贴任何空格
4.我用这些内容创建了一个〜/ .ssh/config:
Host github.com
User git
Hostname github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Run Code Online (Sandbox Code Playgroud)
我已经将.ssh修改为700,id_rsa 600
5.我添加了正确的远程原点而没有输入错别字:git remote add origin git@github.com:medero/cho.git
6.要确认#5,这是我的.git/config.目录是正确的,而不是另一个目录:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = git@github.com:medero/cho.git
Run Code Online (Sandbox Code Playgroud)
7. ssh git@github.com -v给我一个成功的身份验证
8.一个奇怪的事情是,它给我打招呼的用户名已t附加到它上面.我的github用户名medero不是medert.
你好mederot!您已成功通过身份验证,但GitHub不提供shell访问权限.
9. …
我正在寻找一种方式来访问密码提示禁用SSH客户端的注意这里
我无法禁用password:Root Login 的提示.我已将sshd_config文件更改为:
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no
Run Code Online (Sandbox Code Playgroud)
并且还更改了权限chmod 700 ~/.ssh和chmod 600 ~/.ssh/authorized_keys.我错过了什么?这需要我有密码吗?
详细转储:
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/user/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/user/.ssh/id_dsa
debug1: Trying private key: /home/user/.ssh/id_ecdsa
debug1: Next authentication method: password
Run Code Online (Sandbox Code Playgroud)
的/ etc/SSH/sshd_config中:
# Package generated configuration file
# See the sshd_config(5) manpage for details
# What ports, …Run Code Online (Sandbox Code Playgroud)