---
title: "Ubuntu Server 10.04 LTS —— Error & Answer"
author: "Lewis·Lee"
date: "2010-06-29T21:50:49Z"
tags: []
categories: ["操作系统"]
slug: "ubuntu-server-10-04-lts-error-answer"
draft: false
lastmod: "2010-06-30T22:30:47Z"
id: 702066
url: "https://douglee.iteye.com/blog/702066"
---

**sudo: unable to resolve host**

修改主机名导致：

查看主机名 - hostname

修改主机名 - sudo nano /etc/hostname

系统重新启动，才会生效。重启 - exit

注意 ：同时修改 /etc/hosts 文件中的配置，只要将先前的主机名用新的主机名替换即可

比如原先的主机名为 original，新的主机名为 new。Here is an example：

```
原来：
127.0.0.1 localhost
127.0.1.1 original.domain    original

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

更改后：
127.0.0.1 localhost
127.0.1.1 new.domain    new

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
```

 

在 Windows XP 下使用 PuTTY 的 PSCP 命令行 “pscp -scp ” 将本地文件复制到 SSH 服务器，出现“ Network error: Connection refused ” 错误。通过查看 [PuTTY User Manual](http://the.earth.li/~sgtatham/putty/0.60/htmldoc/) 解决了此问题。

```
错误：
F:\PuTTY>pscp -scp F:\id_rsa.pub lewis@192.168.1.199:/home/lewis/.ssh
Fatal: Network error: Connection refused

正确：
F:\PuTTY>pscp -pw 123456 -P 2323 -scp F:\id_rsa.pub lewis@192.168.1.199:/home/le
wis/.ssh
id_rsa.pub                | 0 kB |   0.3 kB/s | ETA: 00:00:00 | 100%
```