分类 Linux 下的文章

下面是 man apt-get 的摘录。使用 upgrade 时应遵守以下规则:在任何情况下都不得删除当前已安装的软件包,也不得检索和安装尚未安装的软件包。如果这对你很重要,那就用 apt-get upgrade。如果你想让一切 "正常运行",你可能需要使用apt-get dist-upgrade来确保依赖关系得到解决。

upgrade

upgrade 用于从/etc/apt/sources.list 列举的源中安装系统当前安装的所有软件包的最新版本。当前安装的软件包如果有新版本可用,则会被检索和升级;在任何情况下,当前安装的软件包都不会被移除,尚未安装的软件包也不会被检索和安装。当前已安装的软件包的新版本,如果不能在不改变其他软件包安装状态的情况下升级,则会保留其当前版本。必须先进行更新,以便 apt-get 知道新版本的软件包可用。

dist-upgrade

除了执行升级功能外,dist-upgrade 还能智能地处理与新版本软件包的依赖关系变化;apt-get 有一个 "智能 "的冲突解决系统,它会尝试升级最重要的软件包,而命令可能会删除某些软件包。/etc/apt/sources.list文件包含一个位置列表,可以从中获取所需的软件包文件。另请参阅 apt_preferences(5),了解覆盖个别软件包常规设置的机制。

deb http://deb.debian.org/debian bookworm main
deb-src http://deb.debian.org/debian bookworm main

deb http://deb.debian.org/debian-security/ bookworm-security main
deb-src http://deb.debian.org/debian-security/ bookworm-security main

deb http://deb.debian.org/debian bookworm-updates main
deb-src http://deb.debian.org/debian bookworm-updates main

Since the colors worked fine while being loggged in directly, I just un-uncommented the line force_color_prompt=yes in the file ~/.bashrc, that gave me colors over ssh, too:

# uncomment for a colored prompt, if the terminal has the capability; turned
# off by default to not distract the user: the focus in a terminal window
# should be on the output of commands, not on the prompt
force_color_prompt=yes

(Ubuntu 18.04 LTS)

https://askubuntu.com/questions/16336/how-to-get-coloured-terminal-over-ssh

Question

Whenever login to debian OS via ssh will get this message:

Linux ds1821-virtual-debian 5.10.0-15-amd64 #1 SMP Debian 5.10.120-1 (2022-06-09) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.

Answer

As Joan notes, motd is the key. The Debian wiki has good information on how the motd file is generated at boot and how to modify it. Check out the How to keep your /etc/motd from being overwritten section to make permanent motd changes.

If you just want to disable it for your user, create a .hushlogin file in your home directory:

touch ~/.hushlogin

https://raspberrypi.stackexchange.com/questions/32006/remove-gnu-licence-and-no-warranty-thing-when-logging-into-ssh/32007

SELinux (Security Enhanced Linux ) is a Linux kernel security module that allows administrators and users more control over access controls. It allows access based on SELinux policy rules.

SELinux policy rules specify how processes and users interact with each other as well as how processes and users interact with files.

When no SELinux policy rule explicitly allows access, such as for a process opening a file, access is denied.

SELinux has three modes:

  • Enforcing: SELinux allows access based on SELinux policy rules.
  • Permissive: SELinux only logs actions that would have been denied if running in enforcing mode.
  • Disabled: No SELinux policy is loaded.

By default, in CentOS 7, SELinux is enabled and in enforcing mode.

It is recommended to keep SELinux in enforcing mode, but in some cases, you may need to set it to a permissive mode or disable it completely.

In this tutorial, we will show you how to disable SELinux on CentOS 7 systems.

- 阅读剩余部分 -