简体   繁体   English

从 bitnami helm chart 部署后的 Pod cassandra-0 root 密码

[英]Pod cassandra-0 root password after deploying from bitnami helm chart

I have deployed a cassandra and I want to edit a file cassandra-env.sh which is inside of the pod for making changes on JVM settings.我已经部署了一个 cassandra,我想编辑一个 cassandra-env.sh 文件,该文件位于 pod 内部,用于更改 JVM 设置。 But I cannot edit the file nor I can install any package, hence it needs sudo permission, How do I install or how to reset the sudo password.但我无法编辑文件,也无法安装任何软件包,因此需要 sudo 权限,如何安装或如何重置 sudo 密码。

(helical-math-347004)$ kubectl get pods (helical-math-347004)$ kubectl 获取 pod

NAME READY STATUS RESTARTS AGE名称 就绪 状态 重新开始 年龄

cassandra-0 2/2 Running 0 4h55m cassandra-client 1/1 Running 0 67m cassandra-0 2/2 运行 0 4h55m cassandra-client 1/1 运行 0 67m 在此处输入图像描述

Sudo will allow your system administrators to grant certain users (or groups of users) the ability to run commands as root. Sudo 将允许您的系统管理员授予某些用户(或用户组)以 root 身份运行命令的能力。 What's important is that all commands and arguments will be logged as part of your security and compliance protocol.重要的是,所有命令和参数都将作为安全和合规协议的一部分进行记录。 Make sure that you configure your sudo security policy to log activity.确保将 sudo 安全策略配置为记录活动。 You can do this using the file /etc/sudoers.您可以使用文件 /etc/sudoers 执行此操作。 Within the sudoers file, configure your groups of users and sets of commands to simplify, and audit server administration with sudo commands.在 sudoers 文件中,配置您的用户组和命令集,以使用 sudo 命令简化和审核服务器管理。

Steps to create a new sudo user创建新 sudo 用户的步骤

1) Log in to your Ubuntu server as the root user . 1)以 root 用户身份登录到您的 Ubuntu 服务器

ssh root@server_ip_address

2) Use the “adduser” command to add a new user to your system. 2) 使用“adduser”命令将新用户添加到您的系统。

3) Use the “usermod” command to add the user to the sudo group. 3) 使用“usermod”命令将用户添加到 sudo 组。

usermod -aG sudo derek

By default, on Ubuntu, members of the sudo group have sudo privileges.默认情况下,在 Ubuntu 上,sudo 组的成员具有 sudo 权限。

4) Test sudo access on the new user account 4) 测试新用户帐户的 sudo 访问权限

  • Use the su command to switch to the new user account.使用 su 命令切换到新的用户帐户。

    su – username su - 用户名

  • As the new user, verify that you can use sudo by adding "sudo" to the beginning of the command that you want to run with superuser privilages.作为新用户,通过在要以超级用户权限运行的命令开头添加“sudo”来验证您是否可以使用 sudo。

    sudo command_to_run sudo command_to_run

  • The first time you use sudo in a session, the system will prompt you for the password of the user account.第一次在会话中使用 sudo 时,系统会提示您输入用户帐户的密码。 Enter the password to proceed.输入密码以继续。

For more detailed steps refer to the link .有关更详细的步骤,请参阅链接

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM