AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-22665

Znarkus's questions

Martin Hope
Znarkus
Asked: 2014-09-16 07:20:00 +0800 CST

sudo 没有密码问题

  • 2

sudo 有问题。作为用户forge,我希望sudo service php5-fpm reload无需输入密码即可运行。我已经尝试了以下所有变体。

forge   ALL=NOPASSWD: /usr/bin/service php5-fpm reload
forge   ALL=NOPASSWD: /usr/bin/service
forge   ALL=(ALL:ALL) NOPASSWD: /usr/bin/service
forge   ALL=(ALL:ALL) NOPASSWD: /usr/bin/service php5-fpm reload

但它一直提示我输入密码。尝试登录和退出。

# tail /var/log/auth.log
Sep 16 09:28:19 apps sudo: pam_unix(sudo:auth): conversation failed
Sep 16 09:28:19 apps sudo: pam_unix(sudo:auth): auth could not identify password for [forge]

这是整个文件。

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification
Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig

# User privilege specification
root    ALL=(ALL:ALL) ALL
#forge  ALL=NOPASSWD: /usr/bin/service

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

使用 Ubuntu 14.04.1 LTS

$ which service
/usr/sbin/service

问题:

$ sudo service 
[sudo] password for forge: 

这是有效的。

视觉:

# Cmnd alias specification
Cmnd_Alias SERVICES = /sbin/service, /sbin/chkconfig/, /usr/bin/service, /usr/sbin/service

/etc/sudoers.d/forge:

forge   ALL = (ALL) NOPASSWD:   SERVICES

试图将forge文件的内容移动到中visudo,但没有奏效。

sudo
  • 2 个回答
  • 8272 Views
Martin Hope
Znarkus
Asked: 2014-03-20 02:53:22 +0800 CST

如何让用户将文件上传到 S3 存储桶,但不覆盖或删除?

  • 24

我对用户有以下 IAM 政策

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "Stmt1395161912000",
      "Effect": "Allow",
      "Action": [
        "s3:ListBucket",
        "s3:PutObject",
        "s3:*"
      ],
      "Resource": [
        "arn:aws:s3:::bucketname"
      ]
    },
    {
      "Sid": "list",
      "Effect": "Allow",
      "Action": [
        "s3:ListAllMyBuckets"
      ],
      "Resource": [
        "arn:aws:s3:::*"
      ]
    }
  ]
}

目标是让用户将文件上传到存储桶,但不能覆盖或删除。是用来备份的。我从ListBucketand开始PutObject,但*由于它不起作用而添加。甚至*不让用户上传文件,只是获取Access Denied.

当我尝试模拟器时,它返回Denied - Implicitly denied (no matching statements found).for ListBucket,这似乎很奇怪,因为我已经隐含地允许这样做。

我已经尝试过 Cyber​​duck 和 3Hub 作为 S3 客户端。

知道有什么问题吗?

amazon-s3
  • 1 个回答
  • 18203 Views
Martin Hope
Znarkus
Asked: 2013-02-05 14:34:40 +0800 CST

使用 X-Accel-Redirect 的 nginx 重定向循环

  • 1

试图让 nginx 与X-Accel-Redirect标题一起工作。我收到此错误:

*24 rewrite or internal redirection cycle while internally redirecting to "/app/index.php", client: 127.0.0.1, server: project.dev, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "project.dev"

nginx 站点配置文件:

server {
    listen      80;
    server_name project.dev;
    root        /www/project;

    location ^~ /f/ {
        internal;
        alias /www/project/files/;
    }

    location / {
        try_files $uri /app/index.php$is_args$args;
    }

    include php.conf;
    include apache.conf;
}

/www/project/app/index.php

<?php
header('X-Accel-Redirect: /f/image.jpg');
exit;

我添加^~到位置块,因为我认为这会终止位置块的匹配,从而解决这个问题。这可能是我的误解。

知道如何解决这个问题吗?


使用 php.conf 和 apache.conf 更新

配置文件:

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
  fastcgi_pass   127.0.0.1:9000;
  fastcgi_index  index.php;
  fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
  include        fastcgi_params;
}

阿帕奇.conf:

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
    deny  all;
}
nginx
  • 2 个回答
  • 2586 Views
Martin Hope
Znarkus
Asked: 2012-09-05 08:47:23 +0800 CST

分析 MySQL 查询日志以找到适当的权限

  • 1

客户的服务器只设置了一个用户,该用户具有执行所有操作的全局权限。我们希望将其更改为每个应用程序一个用户,并具有最低限度的必要权限。

为此,在不破坏任何东西的情况下,我们想分析查询日志,找出执行的查询类型。有这样的工具吗?

最好它会说只执行了SELECT、INSERT、UPDATE和DELETE,我们可以删除所有其他权限。

mysql
  • 1 个回答
  • 109 Views
Martin Hope
Znarkus
Asked: 2012-09-01 00:47:57 +0800 CST

替代软件 RAID 进行镜像

  • 1

我已经在“互联网上”读到 Raid 开始成为当今大磁盘的不合适解决方案。据我了解,重建时间和重建失败的风险是非常有问题的。

这可能是一个模糊的问题,但是在 2012 年是否有比 RAID1 更好的替代方案来镜像 2x 2TB 磁盘?如果没有,我将使用md。

ubuntu
  • 2 个回答
  • 719 Views
Martin Hope
Znarkus
Asked: 2010-02-08 11:50:49 +0800 CST

更改 Apache 的 ServerTokens 无效

  • 5

在 Ubuntu 9.10 中,我无法让 apache 指令ServerTokens正常工作。我的 httpd.conf 如下所示。

ServerName server.mydomain.com
ServerSignature Off
ServerTokens Prod

ServerName 解决了启动警告,但 ServerTokens 没有。Firebug 和 nmap 报告Apache/2.2.12 (Ubuntu)

apache-2.2 configuration
  • 1 个回答
  • 8416 Views
Martin Hope
Znarkus
Asked: 2009-10-12 12:13:04 +0800 CST

Linux目录权限问题

  • 2

为什么我不能访问我应该按组访问的目录?我的用户属于组 www-data,并且该目录具有授予该组的权限。但我无法访问它。

markus@hemulen:~$ ls -la
drwxrwx--- 2 www-data www-data 4096 2009-10-11 21:28 test

markus@hemulen:~$ groups markus 
markus www-data admin

markus@hemulen:~$ cd test
-bash: cd: test: Permission denied
linux
  • 2 个回答
  • 266 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve