如何恢复/重新创建etc / nsswitch.conf文件

我无意中损坏了我的nsswithch.conf文件,现在我的主机无法正常工作。 我该如何恢复或重新创建它?

这个文件比较通用,我会从同一个Ubuntu版本的工作系统中复制它

这至少应该让你前进 – 它是xenial的默认设置,无论几乎任何版本都可以使用。

 # /etc/nsswitch.conf # # Example configuration of GNU Name Service Switch functionality. # If you have the `glibc-doc-reference' and `info' packages installed, try: # `info libc "Name Service Switch"' for information about this file. passwd: compat group: compat shadow: compat gshadow: files hosts: files dns networks: files protocols: db files services: db files ethers: db files rpc: db files netgroup: nis