我试图让其他计算机访问我的本地服务器,但我在本地尝试过,即使我自己也无法在本地访问它。
你应该知道的几件事:
通过http://172.26.141.106:5201/访问我的服务器
我可以通过以下两种方式访问我的服务器:
的结果 ifconfig | grep inet
inet addr:172.17.0.1 Bcast:0.0.0.0 Mask:255.255.0.0
inet addr:172.26.141.106 Bcast:172.26.141.255 Mask:255.255.255.0
inet6 addr: fe80::f767:cd56:9641:d3a9/64 Scope:Link
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
Run Code Online (Sandbox Code Playgroud)
的输出cat /etc/hosts:
127.0.0.1 localhost.localdomain localhost
127.0.0.1 hearen.pc
127.0.0.1 hearen-OptiPlex-7050
127.0.0.1 staging
127.0.0.1 arthas
172.26.141.106 localhost hearen.pc
Run Code Online (Sandbox Code Playgroud)
$ sudo ufw disable
Firewall stopped and disabled on system startup
$ sudo ufw status
Status: inactive
Run Code Online (Sandbox Code Playgroud)
有什么办法让我错过了吗?我想要的只是让其他人通过http://172.26.141.106:5201/访问我的服务器
任何帮助将不胜感激 :)
我读了这本手册,我有点困惑。这是我不理解的:
When your system tries to resolve a hostname to an IP address or determine the
ostname for an IP address, it refers to the /etc/hosts file before using the
name servers
Run Code Online (Sandbox Code Playgroud)
所以:
1)系统何时尝试解析主机名?据我了解,当数据报的标头指定主机名时,对吗?
2)为什么提到hosts之前resolv.conf?
3)主机名解析后,系统转向路由表?
我想设置Ubuntu One在我的机器之间同步主目录中的主机文件。理想情况下,我会在那里设置我所有的本地 Web 开发 URL,它只会在设备之间同步。但我想知道我是否可以进行设置/etc/hosts,使其包含用户主目录中的文件。
在 ubuntu 中,我想为localhost:8080/as创建一个别名www.my-domain.com/。这样每当我输入www.my-domain.com/URL 字段时,它就会从localhost:8080/. 设置它的最简单方法是什么?有没有可以做这个映射的应用程序?
在 Windows 中,我曾经使用 Fiddler2 来实现相同的目标。
我之前安装了 Xubuntu 16.04,它确实识别了我的路由器(Tomato)设置的主机名。
例如,我mate在网络上有一台计算机,其静态 IP 为192.168.2.202,以前我可以这样做:
$ host mate
mate has address 192.168.2.202
Run Code Online (Sandbox Code Playgroud)
但现在我明白了:
$ host mate
Host mate not found: 2(SERVFAIL)
Run Code Online (Sandbox Code Playgroud)
这次我做了一个最小的桌面安装,所以我想知道我是否缺少某个包。
$ cat /var/run/systemd/resolve/resolv.conf:
nameserver 192.168.2.1
Run Code Online (Sandbox Code Playgroud)
$ cat /var/run/NetworkManager/resolv.conf
nameserver 127.0.0.53
Run Code Online (Sandbox Code Playgroud)
$ netstat -antup
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:5000 0.0.0.0:* LISTEN 3421/VBoxHeadless
tcp 0 0 127.0.0.53:53 0.0.0.0:* LISTEN 663/systemd-resolve
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 950/sshd
tcp 0 …Run Code Online (Sandbox Code Playgroud) 我编辑了 /etc/hosts 文件并输入了以下信息:
127.0.0.1 test.com //working
127.0.0.1 https://test.com //not working .
Run Code Online (Sandbox Code Playgroud)
从上面的信息来看,http://test.com正在重定向到 127.0.0.1,但https://test.com没有重定向到 127.0.0.1 。有什么办法可以做到吗?
我有一台旧笔记本电脑,用来学习 Ubuntu Server 12.10。在重新格式化和安装 Ubuntu Server 之前,使用的是 Ubuntu Desktop。
使用 Ubuntu 桌面,我使用 no-ip.com 托管域通过 ssh 访问机器(没问题)。重新格式化后,我尝试使用相同的 no-ip.com 域访问同一台机器(家庭局域网上的相同静态 ip),但现在我收到以下错误:
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 ECDSA key sent by the remote host is
XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX: (Omitted).
Please contact your system administrator.
Add correct host key …Run Code Online (Sandbox Code Playgroud) 我可以只编辑/etc/hosts文件user@<hostname I wish to change>吗,这意味着我可以在不无意中破坏某些内容的情况下登录吗?这是否就足够了,或者还有其他事情要做吗?
我正在尝试在 Windows 10 主机上的 VirtualBox 中创建一个 Ubuntu 16 来宾操作系统。我已经.vdi从oxboxes.org下载了 Ubuntu 16 ,但我不喜欢我必须以osboxes@osboxes. 最终我想以ab@ab.
首先,我使用变更用户名称usermod描述这里的@ValentinUveges答案。这行得通,所以我现在至少可以以ab@osboxes. 要更改@osboxes为@ab我已经尝试过groupmod -n ab osboxes,但这失败了。
但至少我认为我真正需要更改的是/etc/hosts当前包含的文件
cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 osboxes
Run Code Online (Sandbox Code Playgroud)
那么我可以编辑/etc/hosts并更改osboxes为ab以允许我在ab@ab不无意中破坏操作系统的某些部分的情况下登录吗?这是否就足够了,或者还有其他事情要做吗?
除了我之前提到的步骤之外,这是一个“新鲜”的osboxes.vdi虚拟操作系统文件。
遵循本指南:
https://jabriffa.wordpress.com/2015/02/11/installing-torquepbs-job-scheduler-on-ubuntu-14-04-lts/
我在 Ubuntu 16-04-lts 上安装了 TORQUE(他声称该过程在 16.04 上工作相同)
他的安装说明的简短摘要,因此这可以自给自足:
apt-get install torque-server torque-client torque-mom torque-pam
/etc/init.d/torque-mom stop
/etc/init.d/torque-scheduler stop
/etc/init.d/torque-server stop
pbs_server -t create
killall pbs_server
echo SERVER.DOMAIN > /etc/torque/server_name
echo SERVER.DOMAIN > /var/spool/torque/server_priv/acl_svr/acl_hosts
echo root@SERVER.DOMAIN > /var/spool/torque/server_priv/acl_svr/operators
echo root@SERVER.DOMAIN > /var/spool/torque/server_priv/acl_svr/managers
echo "SERVER.DOMAIN np=4" > /var/spool/torque/server_priv/nodes
echo SERVER.DOMAIN > /var/spool/torque/mom_priv/config
/etc/init.d/torque-server start
/etc/init.d/torque-scheduler start
/etc/init.d/torque-mom start
# set scheduling properties
qmgr -c 'set server scheduling = true'
qmgr -c 'set server keep_completed = 300'
qmgr -c 'set server …Run Code Online (Sandbox Code Playgroud)