sudo

JAVA_HOME not found as Sudo

那年仲夏 提交于 2020-04-29 09:09:11
问题 I have a bash script on a Linux box that runs a Jar file. When logged in as a regular user I don't have permission to run the script, but it prints the following log: *INFO * Using JVM found at /opt/jdk6/bin/java When I try to use the script with Sudo though, it gives: *ERROR* Unable to locate java, please make sure java is installed and JAVA_HOME set I've set JAVA_HOME to the same path above — can see it with echo $JAVA_HOME & it's also set as an option within the script. I'm happy that the

sudo cat << EOF > File doesn't work, sudo su does

做~自己de王妃 提交于 2020-04-29 05:28:46
问题 I tried the following on the command prompt in bash: sudo cat << EOF > /etc/yum.repos.d/some-name.repo #Content #.... #... EOF It complained : -bash: /etc/yum.repos.d/some-name.repo: Permission denied Then I did sudo su and tried the exact same thing except the sudo before cat , and it worked without any problem. What am I missing in the above ? 回答1: Output redirection (e.g., >) is performed by bash, not by cat, while running with your UID. To run with root's UID use sudo: sudo bash -c 'cat <

How do I install ffmpeg-binaries without the following error message?

时光毁灭记忆、已成空白 提交于 2020-04-18 06:17:08
问题 I am trying to install ffmpeg-libraries, however, get the same error message every time. I am trying to code a music bot for discord.js and require ffmpeg-libraries. I have tried reinstalling node.js (I am on the current stable version). Louiss-MBP-2:backslashmoderation louisglen$ sudo npm i ffmpeg-binaries Password: lzma-native@3.0.8 install /Users/louisglen/Desktop/Discordjs/BackslashModeration/node_modules/lzma-native node-pre-gyp install --fallback-to-build && node node_modules/rimraf/bin

sudo: java: command not found after exiting from root user

六月ゝ 毕业季﹏ 提交于 2020-04-14 07:50:50
问题 I have installed jdk but when I tried to use the java command it said "command not found". So I then set the environment variable for my account in .bashrc and it works okay. export JAVA_HOME=/usr/java/jdk1.7.0_03 export CLASSPATH=.:$JAVA_HOME/jre/lib/rt.jar:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/l\ ib/tools.jar export PATH=$PATH:$JAVA_HOME/bin However when I try to use sudo to execute java it says that again. So I used sudo -s to switch to root, put those into /etc/profile, and executed source

kali初始命令

落花浮王杯 提交于 2020-04-08 14:05:46
1.apt update 或sudo apt update:更新官网包架构 sudo需要输入管理员密码,再次输入管理员密码即可 2.sudo apt -y full-upgrade:更新安装包,看是否有最新更新,有,则安装 来源: https://www.cnblogs.com/jingzaixin/p/12659499.html

ubuntu server 使用 ss

别来无恙 提交于 2020-04-08 14:04:00
安装 安装ss sudo apt-get install python sudo apt-get install python-pip sudo pip install shadow[敏感词 后面需要加上socks] 配置ss 新建文件 /etc/ss.json 并编辑: { "server": "{your-server}", "server_port": 40002, "local_port": 1080, "password": "{your-password}", "timeout": 600, "method": "aes-256-cfb" } 启动服务: sudo sslocal -c /etc/ss.json -d start 配置全局代理 安装polipo: sudo apt-get install polipo 修改polipo的配置文件 /etc/polipo/config: logSyslog = true logFile = /var/log/polipo/polipo.log proxyAddress = "0.0.0.0" socksParentProxy = "127.0.0.1:1080" socksProxyType = socks5 chunkHighMark = 50331648 objectHighMark = 16384

完美解决错误:libhdf5_hl.so.100(XXX): cannot open shared object file: No such file or directory,Error127

拜拜、爱过 提交于 2020-04-08 04:34:01
sudo make runtest -j16 报错 .build_release/tools/caffe .build_release/tools/caffe: error while loading shared libraries: libhdf5_hl.so.100: cannot open shared object file: No such file or directory Makefile:545: recipe for target 'runtest' failed make: *** [runtest] Error 127解决方案cd /etc/ld.so.conf.d/ touch anaconda3.conf sudo vim anaconda3.conf //打开文件 输入以下内容: /home/user/anaconda3/lib sudo ldconfig 来源: https://www.cnblogs.com/laowangxieboke/p/12657565.html

npm抛出没有sudo的错误

…衆ロ難τιáo~ 提交于 2020-04-07 20:37:36
问题: I just installed node and npm through the package on nodejs.org and whenever I try to search or install something with npm it throws the following error, unless I sudo the command. 我只是通过nodejs.org上的软件包安装了node和npm,并且每当我尝试使用npm搜索或安装某些东西时,都会抛出以下错误,除非我对命令进行了sudo。 I have a feeling this is a permissions issue? 我觉得这是权限问题? I am already the admin. 我已经是管理员。 npm ERR! Error: EACCES, open '/Users/chietala/.npm/-/all/.cache.json' npm ERR! { [Error: EACCES, open '/Users/chietala/.npm/-/all/.cache.json'] npm ERR! errno: 3, npm ERR! code: 'EACCES', npm ERR! path: '/Users/chietala/.npm/-/all/.cache.json' }

Ubuntu 14.04 LTS 安装 VNC Viewer

帅比萌擦擦* 提交于 2020-04-07 19:42:04
1.修改镜像源: /etc/apt/sources.list 将"http://archive.ubuntu.com/ubuntu/"替换为: http://cn.archive.ubuntu.com/ubuntu/ http://mirrors.aliyun.com/ubuntu/ http://mirrors.163.com/ubuntu/ http://mirrors.sohu.com/ubuntu/ 2.更新系统 : sudo apt-get update sudo apt-get upgrade -y 3.安装VNC Viewer : sudo apt-get install vnc4server -y 4.启动VNC Viewer服务器端 ,第一次启动需要输入用户密码: vncserver :1 5.使用VNC Viewer连接 。 6.安装Ubuntu的桌面 : sudo apt-get install ubuntu-desktop -y 7.安装gnome : sudo apt-get install gnome-panel -y sudo apt-get install gnome-settings-daemon -y sudo apt-get install metacity -y sudo apt-get install nautilus -y sudo

一个基于 SSH 用于连接远程 Unix/Linux 系统的工具 mosh

无人久伴 提交于 2020-04-07 19:29:27
mosh 1、 什么是mosh Remote terminal application that allows roaming , supports intermittent connectivity , and provides intelligent local echo and line editing of user keystrokes. Mosh is a replacement for SSH. It's more robust and responsive, especially over Wi-Fi, cellular, and long-distance links. Mosh is free software, available for GNU/Linux, BSD, macOS, Solaris, Android, and Chrome. An iOS version is in testing. Mosh 全名 Mobile Shell ,是 MIT 推出的一个可以替代 SSH 的远程终端程序,适用于 GNU/Linux、FreeBSD、Solaris、Mac OS X 和 Android。它支持间断性连接,允许漫游,提供了本地回显和用户输入的行编辑。高延迟的网络下,Mosh 比 SSH 流畅多了,而且3G网络下,丢失网络变更IP后,终端连接不会中断。