sudo

urllib.request module fails to install in my system

ぃ、小莉子 提交于 2021-02-07 05:13:13
问题 Tried installing urllib.request module using below command sudo pip install urllib.request but it returned Downloading/unpacking urllib.request Could not find any downloads that satisfy the requirement urllib.request Cleaning up... No distributions at all found for urllib.request Storing debug log for failure in /home/mounarajan/.pip/pip.log How can I install this module? 回答1: urllib.request is only available in python3 branch. See the following post for more info. urllib.request in Python 2

urllib.request module fails to install in my system

匆匆过客 提交于 2021-02-07 05:13:07
问题 Tried installing urllib.request module using below command sudo pip install urllib.request but it returned Downloading/unpacking urllib.request Could not find any downloads that satisfy the requirement urllib.request Cleaning up... No distributions at all found for urllib.request Storing debug log for failure in /home/mounarajan/.pip/pip.log How can I install this module? 回答1: urllib.request is only available in python3 branch. See the following post for more info. urllib.request in Python 2

syntax error near unexpected token `do' when run with sudo

雨燕双飞 提交于 2021-02-07 03:27:42
问题 From here: http://www.sat.dundee.ac.uk/psc/watchdog/watchdog-testing.html for n in $(seq 1 60); do echo $n; sleep 1; sync; done I get: :~$ sudo for n in $(seq 1 60); do echo $n; sleep 1; sync; done bash: syntax error near unexpected token `do' 回答1: The shell parses the command line and because for looks like an argument to sudo , you basically get a do without a for . To fix it, run the loop in a subshell, either as a separate script, or like this; sudo sh -c 'for n in $(seq 1 60); do echo "

syntax error near unexpected token `do' when run with sudo

痴心易碎 提交于 2021-02-07 03:21:40
问题 From here: http://www.sat.dundee.ac.uk/psc/watchdog/watchdog-testing.html for n in $(seq 1 60); do echo $n; sleep 1; sync; done I get: :~$ sudo for n in $(seq 1 60); do echo $n; sleep 1; sync; done bash: syntax error near unexpected token `do' 回答1: The shell parses the command line and because for looks like an argument to sudo , you basically get a do without a for . To fix it, run the loop in a subshell, either as a separate script, or like this; sudo sh -c 'for n in $(seq 1 60); do echo "

Generate script in bash and save it to location requiring sudo

北城以北 提交于 2021-02-05 20:23:51
问题 In bash I can create a script with a here-doc like so as per this site: http://tldp.org/LDP/abs/html/abs-guide.html#GENERATESCRIPT ( cat <<'EOF' #!/bin/bash #? [ ] / \ = + < > : ; " , * | #/ ? < > \ : * | ” #Filename="z:"${$winFn//\//\\} echo "This is a generated shell script." App='eval wine "C:\Program Files\foxit\Foxit Reader.exe" "'$winFn'"' $App EOF ) > $OUTFILE If my $OUTFILE is a directory requiring sudo privileges where do I put the sudo command or what else can I do to make it work?

Generate script in bash and save it to location requiring sudo

人盡茶涼 提交于 2021-02-05 20:17:22
问题 In bash I can create a script with a here-doc like so as per this site: http://tldp.org/LDP/abs/html/abs-guide.html#GENERATESCRIPT ( cat <<'EOF' #!/bin/bash #? [ ] / \ = + < > : ; " , * | #/ ? < > \ : * | ” #Filename="z:"${$winFn//\//\\} echo "This is a generated shell script." App='eval wine "C:\Program Files\foxit\Foxit Reader.exe" "'$winFn'"' $App EOF ) > $OUTFILE If my $OUTFILE is a directory requiring sudo privileges where do I put the sudo command or what else can I do to make it work?

sudo inside Jenkins pipeline script

时光总嘲笑我的痴心妄想 提交于 2021-01-29 10:52:54
问题 We have the following setup: We have few UNIX boxes. There are users provisioned to these boxes (ex: spande ). These users have limited privileges, but can do sudo to elevate the permissions (sudo user: admin ). The sudo happens without any password. We have a CICD tool in Jenkins which uses these Unix boxes as slave. We have spande credentials to login into this unix servers via Jenkins. We are using Jenkins Pipeline Scripts (groovy). All is well, but we want the Jenkins script to run with a

Jenkins sudo: no tty present and no askpass program specified with NOPASSWD

主宰稳场 提交于 2021-01-20 16:23:52
问题 I spend several days setting up the file /etc/sudoers to be able to give permissions to root to the user jenkins . I have Jenkins installed on my server because I host several projects with symfony, ionic, neo4j, etc... The problem is that I can not do build in the projects with ionic, I get this error: sudo: no tty present and no askpass program specified. This is the content of my /etc/sudoers file: # # This file MUST be edited with the 'visudo' command as root. # # Please consider adding

增加sudo权限

谁说我不能喝 提交于 2021-01-04 11:59:04
执行sudo的时候报错:username is not in the sudoers file. 假设用户名是 username, 方案有两种 1,root用户执行visudo 命令,在配置文件尾部增加 username ALL=(ALL) ALL 2,还是visudo进入配置文件,里面有一句: ## Uncomment to allow members of group sudo to execute any command # %sudoALL=(ALL) ALL 这家伙,说是这个选项打开后可以允许sudo组的用户执行sudo。好的~~ 首先删掉第二句前面的#号,然后执行下面的命令添加用户到sudo组,完事 usermod -a -G sudo username 附:要是报告不存在sudo组,就先增加sudo组 groupadd sudo =========================== 虽然第一个的步骤比较少~还是感觉第二个方法舒服些~~~ 不为别的,打开配置文件看到一堆英文,脑袋就开始播放各种幻象~ 而且如果再添加第二个、三个、四个用户的时候,就不用再打开配置文件,直接把用户添加进组就可以~~ 附,增加用户到群组命令说明: http://blog.csdn.net/pursue168/article/details/6443046 来源: oschina 链接:

sudo网络权限

妖精的绣舞 提交于 2021-01-04 10:43:24
背景   对于设置了网络代理的服务器,在当前用户下执行网络访问没有问题,但通过sudo执行命令时,就会出现“无网络连接”的错误。 普通权限下,wget成功。 # wget https://github.com --2016-12-08 09:00:43-- https://github.com/ Connecting to 109.105.113.200:8080... connected. Proxy request sent, awaiting response... 200 OK Length: unspecified [text/html] Saving to: ‘index.html’ 2016-12-08 09:01:03 (1.33 KB/s) - ‘index.html’ saved [25692] 使用sudo命令后,连接失败。 # sudo wget https://github.com --2016-12-08 09:01:41-- https://github.com/ Resolving github.com (github.com)... failed: Name or service not known. wget: unable to resolve host address ‘github.com’ 解决方案   出现这种情况的原因