curl:(6)无法解析主机; 401未经授权在Openstack Swift(SAIO)上 [英] curl: (6) could not resolve host ;401 Unauthorized on Openstack Swift (SAIO)

查看:137
本文介绍了curl:(6)无法解析主机; 401未经授权在Openstack Swift(SAIO)上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过以下链接在Ubuntu 12.04 VM上建立"Swift All In One"系统: http://docs.openstack.org/developer/swift/development_saio.html .
我在Win7 64位系统上使用VMware WorkStation 12 Pro,并使用仅主机"网络模式.VMip地址为"192.168.137.200".
当我在VM上运行命令 时:

I'm trying to set up a 'Swift All In One' system on a Ubuntu 12.04 VM by the link:http://docs.openstack.org/developer/swift/development_saio.html.
I use VMware WorkStation 12 Pro on Win7 64bit system and use 'Host-only' network mode.The VM ip address is "192.168.137.200".
When I run the command on the VM:

curl -v -H 'X-Storage-User: test:tester' -H 'X-Storage-Pass: testing' http://192.168.137.200/auth/v1.0

效果很好.
但是当我在主机(Win7平台)上运行命令时,它失败并返回:

It works well.
But when I run the command on the host machine(Win7 platform), It fails and returns:

* Could not resolve host: test:tester'; Host not found
* Closing connection #0
curl: (6) Could not resolve host: test:tester'; Host not found
* Could not resolve host: testing'; Host not found
* Closing connection #0
curl: (6) Could not resolve host: testing'; Host not found
* About to connect() to 192.168.137.200 port 80 (#0)
*   Trying 192.168.137.200... connected
* Connected to 192.168.137.200 (192.168.137.200) port 80 (#0)
> GET /auth/v1.0 HTTP/1.1
> User-Agent: curl/7.20.1 (amd64-pc-win32) libcurl/7.20.1 OpenSSL/0.9.8n zlib/1.
2.3
> Host: 192.168.137.200
> Accept: */*
>
< HTTP/1.1 401 Unauthorized
< Date: Fri, 25 Mar 2016 05:57:24 GMT
< Content-Length: 131
< Content-Type: text/html; charset=UTF-8
< Www-Authenticate: Swift realm="unknown"
< X-Trans-Id: tx081d67bec35b457bb4cb8-0056f4d343
< Vary: Accept-Encoding
<
<html><h1>Unauthorized</h1><p>This server could not verify that you are authoriz
ed to access the document you requested.</p></html>* Connection #0 to host 192.1
68.137.200 left intact
* Closing connection #0

然后我制作另一个Ubuntu 12.04 VM,并尝试在第二个VM上运行上面的命令,它运行良好.

Then I make another Ubuntu 12.04 VM and try to run the command above on the second VM, it works well.

推荐答案

尝试改用X-Auth-User和X-Auth-Key标头.

Try to use X-Auth-User and X-Auth-Key headers instead.
https://swiftstack.com/docs/cookbooks/swift_usage/auth.html

这篇关于curl:(6)无法解析主机; 401未经授权在Openstack Swift(SAIO)上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆