今天本打算用Debian做负载均衡测试,结果发现:
引用
zlex@localhost:~/Desktop$ sudo apt-get install tomcat6
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for zlex:
zlex is not in the sudoers file. This incident will be reported.
sudo不能使用?!顿时无语!
Google搜索无数,发现:
xxx is not in the sudoers file. This incident will be reported.
linux默认没有为当前用户开启sudo权限!
切换到root用户:
su
visudo
实际上是编辑
/etc/sudoers文件
将
zlex ALL=(ALL) ALL加入其中:
引用
# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL) ALL
zlex ALL=(ALL) ALL
# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
# %sudo ALL=NOPASSWD: ALL
再次执行命令:
引用
zlex@localhost:~/Desktop$ sudo apt-get install tomcat6
We trust you have received the usual lecture from the local System
Administrator. It usually boils down to these three things:
#1) Respect the privacy of others.
#2) Think before you type.
#3) With great power comes great responsibility.
[sudo] password for zlex:
正在读取软件包列表... 完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
E: 无法找到软件包 tomcat6
sudo终于可以用了!
有时候我们只需要执行一条root权限的命令也要su到root,是不是有些不方便?这时可以用sudo代替。
补充:
使用
visudo命令,移动光标,找到
root ALL=(ALL) ALL一行,按a,进入append模式,输入
your_user_name ALL=(ALL),然后按Esc,再输入:w保存文件,再:q退出。这样就把自己加入了sudo组,可以使用sudo命令了。
如果觉得在sudo的时候输入密码麻烦,把刚才的输入换成
your_user_name ALL=(ALL)NOPASSWD: ALL
有的时候需要使用到一些服务,譬如使用service命令,启动一些服务,可以这样做:
vim .bashrc
引用
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
export PATH=$PATH:/sbin;
注意加入最后一行
export PATH=$PATH:/sbin;,就可以使用
/sbin/service了!
分享到:
相关推荐
debian安装完之后发现sudo命令不能用 找了半天发现是没有安装sudo 得了,进入root安包,炸开他,apt-get install sudo 安装完发现又出现一堆怪问题 不管他,继续前进 在root设置sudoers配制文件 代码如下:chmod +w ...
能学到什么:设置普通用户执行sudo的权限,使其只能执行指定的命令。 用户使用su命令切换root。但是权限太大,而且root密码有泄露风险。那么能否在不泄露root密码的前提下对权限进行限制呢?答案就是用sudo。 sudo...
Debian Popura仓库要使用该Debian存储库: sudo apt install -y wget apt-transport-httpssudo wget -O /usr/share/keyrings/popura-archive-keyring.gpg ...[signed-by=/usr/share/keyrings/popura-archive-keyring....
debian-CD 首先安装 simple-cdd 包: sudo apt-get install simple-cdd 然后运行以下命令为 CD 构建 ISO 映像: build-simple-cdd --profiles base,vm --auto-profiles base,vm --dist wheezy 输出文件images/...
使用 Clang 测试构建 debian 包 配置 使用 更改 sbuild 配置,将以下行添加到~/.sbuildrc : # Do not update chroot everytime i.e. you need to take care of that yourself! $apt_update = 0; $apt_upgrade = 0...
lxqt-sudo概述lxqt-sudo分别是命令sudo和su的图形前端。 这样,它使普通用户可以使用其他用户(包括root)的权限启动应用程序。安装编译源代码运行时依赖项是qtbase,sudo(应在所有* ix操作系统上默认安装su)和 。...
1。选择合适的Ubuntu版本 在系统安装篇已经说过了,32位CPU用户...64位系统同样能使用32位的软件,只要在终端输入以下命令,安装相应的32位包: sudo apt-get install ia32-libs ia32-libs-gtk linux32 lib32asound2
使用sunxi内核和引导文件引导最小的debian rootfs。 目前只有4个olinuxino板可用。 该存储库中的所有脚本都是通用的,因此添加新的Boad很容易。 如果您创建并测试新板,请提出拉取请求。 我需要olinuxino lime2和...
java8 看不到源码Spring 启动 debian ...如果不存在传递依赖项,请使用以下命令: sudo apt-get -fy install 如果安装日志中没有错误,则安装并成功启动具有所有必需依赖项的gs-spring-boot应用程序。
在基于DebianLinux上: sudo apt-get install libx11-dev libxkbfile-dev 在基于Red HatLinux上: sudo yum install libx11-devel.x86_64 libxkbfile-devel.x86_64 # or .i686 在基于SUSELinux上: sudo zypper ...
用于Netcup根服务器的Debian服务器设置 图像 网杯:Debian(10)Buster 基本配置 更新软件 通过Webconsole以root身份登录 apt-get update apt-get upgrade apt-get install curl pydf unzip git apparmor-utils 编辑...
在Debian上,您需要sudo权限和以下软件包: # if you build on wheezy please use backports version of debootstrap sudo apt-get -qq -y install debootstrap 在Devuan上,您需要sudo权限和以下软件包: sudo ...
keytar - 管理系统钥匙串的节点模块 ... Debian/Ubuntu: sudo apt-get install libsecret-1-dev 基于 Red Hat: sudo yum install libsecret-devel Arch Linux: sudo pacman -S libsecret 建造 克隆存储库
启用了Bootstrap的hotdoc主题获取依赖首先确保已安装nodejs在软呢帽上: sudo dnf install nodejs关于debian和朋友: sudo apt-get install nodejs nodejs-legacy npm # debian在Arch Linux上: sudo pacman -S ...
看不到源码野蝇debian Wildfly 的 Debian 和 Ubuntu 打包 最初基于 通过 PPA 安装 Wildfly 包 如果系统上尚未满足java8-runtime虚拟包依赖项,您可能需要先安装openjdk-8-jre-headless包: sudo apt-get install ...
debian10安装qq、微信、迅雷、winrar等(2020.3.16)1.加key2.vi /etc/apt/sources.list 加入新源3.安装deepin wine环境,https://gitee.com/wszqkzqk/deepin-wine-for-ubuntu4.安装QQ、微信、迅雷、winrar等 1.加...
您可以选择滚动发布: 稳定发布: 要求: Python3.9.x(推荐) 对于安装Python3软件包, 在Arch Linux上: sudo pacman -S python3基于Debian的: sudo apt update && sudo apt install -y python3吉特对于安装Git...
sudo pacman -S git python-pip 基于Debian的: sudo apt install python3-dev git -y pip3 install -r requirements.txt 每个齿轮的其他要求(如果要禁用齿轮,则不需要它的要求): 音乐: 拱门: sudo pacman -S...