我在Windows 7机器上运行了一个Ubuntu VM.如何设置它以便我可以通过SSH从外部访问Web服务器?
我发现步骤(在VirtualBox主机和来宾VM之间设置SSH访问)能够从我的主机ssh到我的客人,但这仍然让我遇到通过我的路由器访问它的问题.
我想我可以在我的Windows机器上安装一个SSH服务器然后隧道几次(虽然我不是100%确定在本地,动态等方面使用什么或者如何设置多个隧道?),但有没有办法让我的路由器可以直接访问VM,所以我可以直接移植到它?
我在Mac Snow Leopard上,我刚刚安装完毕git.
我刚试过
git clone git@thechaw.com:cakebook.git
Run Code Online (Sandbox Code Playgroud)
但这给了我这个错误:
Initialized empty Git repository in `/Users/username/Documents/cakebook/.git/`
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
我也尝试过ssh-keygen没有passphase,但仍然是同样的错误.
我重新安装了我的服务器,我收到这些消息:
[user@hostname ~]$ ssh root@pong
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
6e:45:f9:a8:af:38:3d:a1:a5:c7:76:1d:02:f8:77:00.
Please contact your system administrator.
Add correct host key in /home/hostname /.ssh/known_hosts to get rid of this message.
Offending RSA key …Run Code Online (Sandbox Code Playgroud) 对于给定的输入字符串进行查找和替换的最简单方法是什么,比方说abc,并替换为另一个字符串,比如XYZ在文件中/tmp/file.txt?
我正在编写一个应用程序并使用IronPython通过SSH执行命令 - 但我不熟悉Unix,也不知道要查找什么.
我听说Bash除了是命令行界面外,还可以是一种非常强大的脚本语言.所以,如果这是真的,我假设您可以执行这些操作.
我能用bash做什么,以及实现目标的最简单(一行)脚本是什么?
我刚刚生成了我的RSA密钥对,我想将该密钥添加到GitHub.
我试过cd id_rsa.pub和id_rsa.pub,但没有运气.如何访问SSH公钥?
我正在命令行上SSH到远程服务器,并尝试使用该scp命令将目录复制到我的本地计算机上.但是,远程服务器返回此"使用"消息:
[Stewart:console/ebooks/discostat] jmm% scp -p ./styles/
usage: scp [-1246BCEpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
[-l limit] [-o ssh_option] [-P port] [-S program]
[[user@]host1:]file1 [...] [[user@]host2:]file2
[Stewart:console/ebooks/discostat] jmm%
Run Code Online (Sandbox Code Playgroud)
我希望能够在两个方向上传输文件.从我读到的,我认为上面的命令可以用于下载和scp -p [localpath] [remotepath]上传?
我有一个受密码保护的私钥,可以通过SSH访问服务器.
我有2台linux(ubuntu 10.04)机器,ssh-add命令的行为在两者中都不同.
在一台机器上,一旦我使用"ssh-add .ssh/identity"并输入我的密码,密钥就会被永久添加,即每次关闭计算机并再次登录时,密钥都已添加.
在另一个中,我必须在每次登录时添加密钥.
据我记忆,我对两者做了同样的事情.唯一的区别是密钥是在永久添加的密钥上创建的.
有谁知道如何永久地将它添加到其他机器?
我将公共ssh密钥添加到authorized_keys文件中. ssh localhost应该登录我而不要求密码.
我这样做并尝试打字ssh localhost,但它仍然要求我输入密码.我还有其他任何设置可以让它运作吗?
我遵循了更改权限的说明:
如果我这样做,下面是结果 ssh -v localhost
debug1: Reading configuration data /home/john/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 22.
debug1: Connection established.
debug1: identity file /home/john/.ssh/identity type 1
debug1: identity file /home/john/.ssh/id_rsa type -1
debug1: identity file /home/john/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_4.7p1 Debian-8ubuntu3
debug1: match: OpenSSH_4.7p1 Debian-8ubuntu3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: …Run Code Online (Sandbox Code Playgroud) 我试图让一个Python脚本在我通过ssh连接的linux服务器上运行.该脚本使用mysqldb.我有我需要的所有其他组件,但是当我尝试通过setuptools安装mySQLdb时,如:
python setup.py install
Run Code Online (Sandbox Code Playgroud)
我得到以下与该mysql_config命令相关的错误报告.
sh: mysql_config: command not found
Traceback (most recent call last):
File "setup.py", line 15, in <module>
metadata, options = get_config()
File "/usr/lib/python2.5/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/usr/lib/python2.5/MySQL-python-1.2.3/setup_posix.py", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found
Run Code Online (Sandbox Code Playgroud)
是否有其他人遇到此错误,如果是这样,您是如何解决它/我该怎么做才能成功安装mysqldb?
当我克隆存储库时,我一直在"忍受"Github总是询问我的用户名和密码.我想绕过这一步,因为这是我工作流程中的一个烦恼.
我尝试使用本指南设置SSH密钥(我成功完成了).https://help.github.com/articles/generating-ssh-keys我成功了.
我的问题是,在克隆存储库时(使用SSH),我仍然被要求输入我的github密码和密码.我的理解是,在设置了这个SSH密钥后,我不再需要这样做了.
我有点不确定要问什么,所以我只是陈述我的目标.
我希望能够克隆存储库而无需一直输入我的Github信息.
我的SSH密钥丢失了什么?如果有人可以提供一些指导或资源,我会很感激,因为在GitHub中进行SSH身份验证时,我总是感到有些失落.
据我所知,这是一个测试事情是否正常工作的命令,这是我控制台的输出:
~ $ ssh -T git@github.com
Saving password to keychain failed
Enter passphrase for key '/Users/MYNAME/.ssh/id_rsa':
Hi MYNAME! You've successfully authenticated, but GitHub does not provide shell access.
Run Code Online (Sandbox Code Playgroud)
当我输入密码时,首先应该失败吗?然后,当我输入我的密码时,它会通过.
ssh ×10
git ×3
public-key ×2
ssh-keys ×2
bash ×1
github ×1
ipa ×1
ironpython ×1
key ×1
linux ×1
mysql-python ×1
python ×1
replace ×1
rsa ×1
scp ×1
scripting ×1
ssh-agent ×1
ubuntu ×1
verification ×1
virtualbox ×1