sudo

Running as a host user within a Docker container

有些话、适合烂在心里 提交于 2021-02-17 15:13:32
问题 In my team we use Docker containers to locally run our website applications while we do development on them. Assuming I'm working on a Flask app at app.py with dependencies in requirements.txt , a working flow would look roughly like this: # I am "robin" and I am in the docker group $ whoami robin $ groups robin docker # Install dependencies into a docker volume $ docker run -ti -v `pwd`:`pwd` -w `pwd` -v pydeps:/usr/local python:3-slim pip install -r requirements.txt Collecting Flask==0.12.2

Running as a host user within a Docker container

只谈情不闲聊 提交于 2021-02-17 15:12:58
问题 In my team we use Docker containers to locally run our website applications while we do development on them. Assuming I'm working on a Flask app at app.py with dependencies in requirements.txt , a working flow would look roughly like this: # I am "robin" and I am in the docker group $ whoami robin $ groups robin docker # Install dependencies into a docker volume $ docker run -ti -v `pwd`:`pwd` -w `pwd` -v pydeps:/usr/local python:3-slim pip install -r requirements.txt Collecting Flask==0.12.2

sudo python wrong version

你离开我真会死。 提交于 2021-02-16 18:06:56
问题 I get python 2.7 when running sudo. I've tried changing my .bash_profile and .bashrc from my original user and root, but to no avail. $ python Python 3.5.2 (default, Oct 11 2016, 05:05:28) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.38)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> ^D $ sudo python Python 2.7.10 (default, Oct 23 2015, 19:19:21) [GCC 4.2.1 Compatible Apple LLVM 7.0.0 (clang-700.0.59.5)] on darwin Type "help", "copyright",

sudo mkdir in /usr/, Operation not permitted. El Capitan [closed]

佐手、 提交于 2021-02-16 04:20:22
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 1 year ago . Improve this question Attempting to install PHP, which requires the creation of an extensions directory within /usr/lib/php/extensions . The installation returned an error "Operation not permitted". I have since found out, sudo is not able to create any directories under /usr/ . Anyone

sudo mkdir in /usr/, Operation not permitted. El Capitan [closed]

南楼画角 提交于 2021-02-16 04:20:12
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 1 year ago . Improve this question Attempting to install PHP, which requires the creation of an extensions directory within /usr/lib/php/extensions . The installation returned an error "Operation not permitted". I have since found out, sudo is not able to create any directories under /usr/ . Anyone

sudo mkdir in /usr/, Operation not permitted. El Capitan [closed]

天涯浪子 提交于 2021-02-16 04:19:06
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 1 year ago . Improve this question Attempting to install PHP, which requires the creation of an extensions directory within /usr/lib/php/extensions . The installation returned an error "Operation not permitted". I have since found out, sudo is not able to create any directories under /usr/ . Anyone

Which user is AppleScript using when executing scripts

拥有回忆 提交于 2021-02-11 15:52:06
问题 • Here is the script to be executed via AppleScript: bash-3.2$ cd /Users/jack/Desktop/ bash-3.2$ ls -l | grep static -rwxrwxrwx 1 jack admin 65 5 May 08:10 static-routes.sh bash-3.2$ cat static-routes.sh #!/bin/bash sudo route -n add -net 192.168.3.0/24 172.16.254.134 ~ • AppleScript contains the following: do shell script "~/Desktop/static-routes.sh" • When executing the script from within an AppleScript, by clicking on "Run" button, pop up window saying: Script Error sudo: a terminal is

Which user is AppleScript using when executing scripts

走远了吗. 提交于 2021-02-11 15:51:00
问题 • Here is the script to be executed via AppleScript: bash-3.2$ cd /Users/jack/Desktop/ bash-3.2$ ls -l | grep static -rwxrwxrwx 1 jack admin 65 5 May 08:10 static-routes.sh bash-3.2$ cat static-routes.sh #!/bin/bash sudo route -n add -net 192.168.3.0/24 172.16.254.134 ~ • AppleScript contains the following: do shell script "~/Desktop/static-routes.sh" • When executing the script from within an AppleScript, by clicking on "Run" button, pop up window saying: Script Error sudo: a terminal is

Symfony 5 and sudo commad using Windows 10

孤街醉人 提交于 2021-02-11 12:19:07
问题 I am following Fabien Potencier's book "Symfony 5: The Fast Track". I develop the project using Windows 10 pro 64 bit. The author of the book, however, works with Linux. In chapter 27 the following command should be executed, which works on Linux, but not on Windows 10: sudo API_ENDPOINT = 'symfony var: export SYMFONY_DEFAULT_ROUTE_URL --dir = ..' yarn encore dev I have installed Sudo for Windows, but the problem is not solved. How do I run this command on Windws 10? 来源: https://stackoverflow

Getting “must be run from a terminal” when switching to root user using Paramiko module in Python

ぐ巨炮叔叔 提交于 2021-02-07 20:33:26
问题 I am trying to automate a task through a Python script. The idea is to login as a regular user and then send a su command and switch to the root account. The reason I can't directly login as root is that SSHD doesn't allow root logins. Here's what I have: ip='192.168.105.8' port=22 username='xyz' password='abc' ssh=paramiko.SSHClient() ssh.set_missing_host_key_policy(paramiko.AutoAddPolicy()) ssh.connect(ip,port,username,password) print ("SSH connection established") stdin,stdout,stderr=ssh