AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[etc](ubuntu)

Martin Hope
Yuri Sucupira
Asked: 2020-12-15 02:12:27 +0800 CST

如何从任何官方(本地或远程)存储库中获取 Ubuntu 默认 /etc/crontab 文件的精确副本?[复制]

  • 0
这个问题在这里已经有了答案:
如何恢复配置文件? (7 个回答)
1 年前关闭。

长话短说:我不小心删除了 64 位 Ubuntu 20.04 安装程序在我的计算机上安装 Ubuntu 期间放入的默认内容/etc/crontab,所以现在我试图找出是否有可能从Ubuntu ISO 安装文件的内部(例如“本地存储库”,例如ubuntu-20.04-amd64.iso)或远程存储库(例如托管在 ubuntu.com 或其他地方),因此我可以将此默认crontab文件放回/etc.

我安装了 Ubuntu 20.04 ISO 并在其中运行sudo ls -lR | grep -i crontab,但没有crontab找到文件,因此我想它可能被压缩在此类 ISO 文件中的一个文件中,或者系统 crontab可以在 ubuntu 的某个地方下载.com 网络或 Launchpad 的 PPA:我只是不知道。


长话短说:在使用流水线时|,为了将命令的 1 行输出附加到/etc/crontab,我不小心输入了:

| sudo tee /etc/crontab

...代替:

| sudo tee -a /etc/crontab

...因此最终/etc/crontab仅用 1 行替换了 的全部内容,而不是将这样的 1 行添加到此类文件的末尾。绝望!

不过,幸运的是,这是我第一次尝试修改此类文件,因此其内容是 Ubuntu 在安装过程中创建的默认内容。但它的内容是什么?

我决定运行info crontab并发现似乎是相同的默认内容/etc/crontab(但我不太确定):

# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d.  These files also have username fields,
# that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# Example of job definition:
#.-------------<-------- minute (0 - 59)
#| .------------<------- hour (0 - 23)
#| | .-----------<------ day of month (1 - 31)
#| | | .----------<----- month (1 - 12) OR jan,feb,mar,apr ...
#| | | | .---------<---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
#| | | | |  .-------<--- user
#| | | | |  |     .--<-- command
#| | | | |  |     |
#v v v v v  v     v
17 * * * *  root  cd / && run-parts --report /etc/cron.hourly
25 6 * * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7  root  test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * *  root  test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#

/etc/crontab然后我决定用 owner:group = root:root ( sudo chown root:root /etc/crontab)将上面的代码保存在一个全新的文件中,然后用sudo chmod 755 /etc/crontab. 在我这样做之后,我还创建了它的备份副本,sudo cp /etc/crontab /etc/crontab.bak并创建了它的骨架(即模板)sudo cp /etc/crontab /etc/skel/crontab......

...但我不禁想知道上面的代码是否确实与 Ubuntu 20.04 安装程序/etc/crontab在 Ubuntu 安装期间在其中创建的代码完全相同,我也不知道如何获取此类原始/默认文件的精确副本(如果有的话)。

default cron restore etc
  • 2 个回答
  • 587 Views
Martin Hope
mathway
Asked: 2020-08-05 09:16:41 +0800 CST

/etc/login.defs 中单词的含义

  • 0

社区!

打印后/etc/login.defs,我遇到了像#290803和#298773这样的神奇数字。我想他们参考了一些有关安全风险的文档,但我在哪里可以找到它?

分段:

# Enable display of unknown usernames when login failures are recorded.
#
# WARNING: Unknown usernames may become world readable. 
# See #290803 and #298773 for details about how this could become a security
# concern
LOG_UNKFAIL_ENAB        no
configuration security etc 18.04
  • 1 个回答
  • 114 Views
Martin Hope
Maks.Burkov
Asked: 2019-02-07 06:29:48 +0800 CST

Vundle(Vim 插件)配置问题

  • 0

我在我的文件中编写了以下配置/etc/vim/vimrc来运行 Vundle 插件。

为什么我得到这个错误?

我添加的 Vim 配置块:

set nocompatible              " be iMproved, required
filetype off                  " required

" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')

" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'

" All of your Plugins must be added before the following line
call vundle#end()            " required
filetype plugin indent on    " required
" To ignore plugin indent changes, instead use:
"filetype plugin on
"
" Brief help
" :PluginList       - lists configured plugins
" :PluginInstall    - installs plugins; append `!` to update or just :PluginUpdate
" :PluginSearch foo - searches for foo; append `!` to refresh local cache
" :PluginClean      - confirms removal of unused plugins; append `!` to auto-approve removal
"
" see :h vundle for more details or wiki for FAQ
" Put your non-Plugin stuff after this line

我在运行时遇到了这些错误.vimrc:

root@someone-System-Product-Name:/etc/vim# vim vimrc
Error detected while processing /usr/share/vim/vimrc:
line    6:
E117: Unknown function: vundle#begin
line   11:
E492: Not an editor command: Plugin 'VundleVim/Vundle.vim'
line   14:
E117: Unknown function: vundle#end
Press ENTER or type command to continue

如果我运行:PluginInstall,我得到了错误'Not an editor command'。

configuration vim command-line root etc
  • 1 个回答
  • 851 Views
Martin Hope
Bipa
Asked: 2018-12-19 05:46:31 +0800 CST

意外重命名 /etc 后,如何重命名?

  • 38

我正在使用 Ubuntu 18.04。

我将/etc文件夹重命名为apache2. 那是我最大的错误

现在我无法重命名它,因为我需要使用sudo,但是当我尝试时出现错误

sudo: unknown uid 1000

我该如何解决这个问题?我没有可以启动的实时系统,并且在恢复模式下,根终端打开但然后关闭说cannot open password database.

sudo etc
  • 3 个回答
  • 7626 Views
Martin Hope
Tehryn
Asked: 2018-11-07 16:11:34 +0800 CST

以 root 身份运行 /etc/profile.d/script.sh

  • 1

我的脚本/etc/profile.d/script.sh包含 3 行:

ifconfig ens5f5 down
hw ether xx:xx:xx:xx:xx:xx
ifconfig ensf5f

当任何用户登录时,我需要以 root 身份运行此脚本。

这里写到所有脚本/etc/profile.d/script.sh都以root身份执行:https ://stackoverflow.com/questions/47997365/execute-scripts-in-etc-profile-d-at-startup-as-root

我相信 Ubuntu 18.04 不是这样,因为我因为缺少权限而遇到错误。

如果您不理解这些命令,我​​正在尝试永久更改 MAC 地址。我知道,正确的方法是更改​​文件/etc/network/interfaces,但是我在配置该文件时遇到了很多麻烦。

permissions startup etc
  • 1 个回答
  • 3170 Views
Martin Hope
Seenu S
Asked: 2018-08-03 01:50:49 +0800 CST

Ubuntu 18.04 LTS 的 Apt 包更新失败

  • 5

sudo apt update 在 ubuntu 18.04 中失败。

E: Release file for http://in.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease is not valid yet (invalid for another 11h 10min 58s). Updates for this repository will not be applied.

E: Release file for http://in.archive.ubuntu.com/ubuntu/dists/bionic-backports/InRelease is not valid yet (invalid for another 11h 11min 16s). Updates for this repository will not be applied.

E: Release file for http://security.ubuntu.com/ubuntu/dists/bionic-security/InRelease is not valid yet (invalid for another 11h 10min 50s). Updates for this repository will not be applied.

source.list 文件如下所示

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://in.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://in.archive.ubuntu.com/ubuntu/ bionic main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://in.archive.ubuntu.com/ubuntu/ bionic-updates main restricted
# deb-src http://in.archive.ubuntu.com/ubuntu/ bionic-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ bionic universe
# deb-src http://in.archive.ubuntu.com/ubuntu/ bionic universe
deb http://in.archive.ubuntu.com/ubuntu/ bionic-updates universe
# deb-src http://in.archive.ubuntu.com/ubuntu/ bionic-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://in.archive.ubuntu.com/ubuntu/ bionic multiverse
# deb-src http://in.archive.ubuntu.com/ubuntu/ bionic multiverse
deb http://in.archive.ubuntu.com/ubuntu/ bionic-updates multiverse
# deb-src http://in.archive.ubuntu.com/ubuntu/ bionic-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://in.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src http://in.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu bionic partner
# deb-src http://archive.canonical.com/ubuntu bionic partner

deb http://security.ubuntu.com/ubuntu bionic-security main restricted
# deb-src http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://security.ubuntu.com/ubuntu bionic-security universe
# deb-src http://security.ubuntu.com/ubuntu bionic-security universe
deb http://security.ubuntu.com/ubuntu bionic-security multiverse

任何人都可以帮助我解决这个问题。

apt software-sources etc 18.04
  • 1 个回答
  • 22674 Views
Martin Hope
Alex
Asked: 2018-03-20 21:24:17 +0800 CST

如何恢复 /etc/profile?[复制]

  • 15
这个问题在这里已经有了答案:
如何恢复配置文件? (7 个回答)
4年前关闭。

我正在处理一个追加/etc/profile但不是追加的bash脚本,我不小心写了它,丢失了它的所有内容。如何恢复文件?我确实在这里搜索过,但对 Ubuntu 来说是新手,我不知道/etc/profile我在其他问题中看到的发布内容是否是默认内容。

.profile etc
  • 1 个回答
  • 6726 Views
Martin Hope
Srideep Nayak
Asked: 2018-01-03 22:48:54 +0800 CST

启动系统时ubuntu中的etc错误

  • -1

错误截图 在安装 Java 时,我做了一些事情,现在出现了这个错误。

etc
  • 1 个回答
  • 116 Views
Martin Hope
Old Geezer
Asked: 2015-11-19 00:51:56 +0800 CST

在哪里可以找到有关 xxx.d 文件夹的更多信息?

  • 4

我在文件夹中看到各种对“自定义”文件夹的引用/etc,名称与某些配置文件匹配,例如/etc/resolv.conf并附加了.d. 例子是resolv.conf.d或cron.d。

我在哪里可以找到有关此文件夹结构、其中可以包含的文件类型、优先顺序等的更多文档。

etc
  • 1 个回答
  • 543 Views
Martin Hope
Daniel
Asked: 2014-06-30 05:15:08 +0800 CST

如何理解配置文件语法?

  • 2

现在我知道这有点抽象,但是人们如何知道如何编辑配置文件,例如/etc/systemd/logind.conf,您如何知道允许使用什么语法以及不允许使用什么语法?

etc
  • 1 个回答
  • 1387 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve