分类 Linux 下的文章

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

1. Install sudo. Some installations do not come with sudo installed. If your does not, install sudo with apt.

# apt install sudo

2. Create a new user account with the adduser command. Use a strong password for the new user. You can enter values for the user information, or press ENTER to leave those fields blank.

# adduser example_user
Adding user `example_user' ...
Adding new group `example_user' (1001) ...
Adding new user `example_user' (1001) with group `example_user' ...
Creating home directory `/home/example_user' ...
Copying files from `/etc/skel' ...
New password:
Retype new password:
passwd: password updated successfully
Changing the user information for example_user
Enter the new value, or press ENTER for the default
        Full Name []: Example User
        Room Number []:
        Work Phone []:
        Home Phone []:
        Other []:
Is the information correct? [Y/n] y

3. Add the new user to the sudo group.

# adduser example_user sudo

4. Test by switching to the new user.

# su - example_user

Verify you are the new user with whoami, then test sudo access with sudo whoami, which should return root.

$ whoami
example_user
$ sudo whoami
[sudo] password for example_user:
root
How to use Sudo on a Vultr Cloud Server

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.

- 阅读剩余部分 -