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-190919

Pradeep Gupta's questions

Martin Hope
Pradeep Gupta
Asked: 2014-03-26 09:03:12 +0800 CST

想通过使用脚本为tightvnc服务器提供密码

  • 0

我正在使用 ruby​​ 脚本在我的 ubuntu 机器上安装tightvnc 服务器,我的脚本包含以下内容:

#!/usr/bin/ruby env    
`sudo apt-get --force-yes -y install tightvncserver`
`printf "%s\n%s\n" "demo123" "demo123" | vncserver :1`

我使用 printf 方式,因为 vncserver 在终端上要求输入密码,但是这种方式失败了,他们有没有更好的方法来解决这个问题?

我想使用 ruby​​ 脚本提供密码,这样终端就不会提示并要求用户提供密码。希望这清楚

ruby
  • 1 个回答
  • 85 Views
Martin Hope
Pradeep Gupta
Asked: 2013-12-10 06:53:23 +0800 CST

如何在 Ubuntu Server 13.10 的 preseed.cfg 中包含其他软件

  • 3

我正在做 Ubuntu Server (Saucy) 13.10 的全自动安装,还想包含自定义的附加软件,preseed.cfg 的格式是:

d-i debian-installer/locale string en_US
d-i debian-installer/language string en
d-i debian-installer/country string NL
d-i debian-installer/locale string en_GB.UTF-8
d-i console-setup/ask_detect boolean false
d-i keyboard-configuration/modelcode string pc105
d-i keyboard-configuration/layoutcode string us
d-i netcfg/choose_interface select auto
d-i netcfg/dhcp_failed note
d-i netcfg/dhcp_options select Configure network manually
d-i netcfg/get_nameservers string 192.168.1.1
d-i netcfg/get_ipaddress string 192.168.1.42
d-i netcfg/get_netmask string 255.255.255.0
d-i netcfg/get_gateway string 192.168.1.1
d-i netcfg/confirm_static boolean true
d-i netcfg/get_hostname string demo
d-i netcfg/get_domain string www.demo.com
d-i netcfg/wireless_wep string
d-i mirror/country string manual
d-i mirror/http/hostname string archive.ubuntu.com
d-i mirror/http/directory string /ubuntu
d-i mirror/http/proxy string
d-i mirror/http/mirror select CC.archive.ubuntu.com
d-i clock-setup/utc boolean true
d-i time/zone string US/Eastern
d-i clock-setup/ntp boolean true
d-i clock-setup/ntp-server string ntp.example.com
d-i partman-auto/disk string /dev/sda
d-i partman-auto/method string regular
d-i partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i partman-md/confirm boolean true
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
d-i passwd/user-fullname string demo
d-i passwd/username string demo
d-i passwd/user-password password demo123
d-i passwd/user-password-again password demo123
d-i user-setup/allow-password-weak boolean true
d-i user-setup/encrypt-home boolean false
tasksel tasksel/first multiselect ubuntu-desktop
d-i pkgsel/include string openssh-server build-essential juju ruby virtualbox kvm git openstack
d-i pkgsel/update-policy select none
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i finish-install/reboot_in_progress note

我尝试通过在 %post 末尾写入自定义软件 juju、openstack 来包含它们,通过这种方式:

%post
juju
git
openstack
ruby

但是我遇到了解析错误,现在我尝试将这些软件包含在 pkgsel/include 中,但又遇到了错误,有什么办法可以解决这个问题吗?

ubuntu
  • 3 个回答
  • 8515 Views
Martin Hope
Pradeep Gupta
Asked: 2013-10-05 07:01:02 +0800 CST

如何使用带有身份验证的 Nginx 用户目录

  • 3

我正在使用基于 Debian 的主机并使用 Nginx 和 PHP-FPM,我想在 nginx 中启用用户目录,并且还希望通过基本身份验证来支持多用户。这意味着当 Alex 打开 www.example.com/rutorrent;这将提示输入登录名和密码并在身份验证后,这应该指向他自己的位于 /home/alex/www/rutorrent 的 php 脚本版本以及 Bob 何时打开 www.example.com/rutorrent;这将提示登录和密码和身份验证后这应该指向他位于 /home/bob/www/rutorrent 的 php 脚本。

我已经尝试过位于此处的官方文档: http ://wiki.nginx.org/UserDir

但我不确定如何将它们配置到默认文件中,以便我可以获得所需的功能,我的 nginx 的默认配置文件在这里:

server {
    server_name localhost;

    location / {
          try_files $uri $uri/ /index.html;
    }

    location /doc/ {
           alias /usr/share/doc/;
           autoindex on;
           allow 127.0.0.1;
           allow ::1;
           deny all;
     }

     index index.php index.html index.htm;
     location ~ ^/~([^/]*)(.*)\.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/var/run/php5-fpm.sock;
            auth_basic "Restricted";
            auth_basic_user_file /etc/nginx/sites-available/.htpasswd;
            fastcgi_param SCRIPT_FILENAME /home/$1/www$2.php;
            include fastcgi_params;

     }

     location ~ ^/~([^/]*)(.*) {
            autoindex on;
            alias /home/$1/www$2;
            auth_basic "Restricted";
            auth_basic_user_file /etc/nginx/sites-available/.htpasswd;
     }

      location /RPC2 {
            include scgi_params;
            scgi_pass localhost:5000;
     }


}

有没有办法得到这个?

nginx
  • 2 个回答
  • 1179 Views
Martin Hope
Pradeep Gupta
Asked: 2013-09-30 04:02:21 +0800 CST

在 Lighttpd 上启用用户目录后,我在重新启动 Lighttpd 服务器后失败了

  • 1

我使用 Debian 7 64 作为主机,并安装了支持 mysql 的 Lighttpd 和 PHP-FPM,全新安装 lighttpd 和 PHP-FPM 后,我尝试启用用户目录并运行以下命令:

[email protected]# lighty-enable-mod userdir

运行上面的命令后我得到了 Ok messege,但是当我运行下面的命令重新启动 lig​​httpd 时,我得到以下输出:

[email protected]# /etc/init.d/lighttpd force-reload
[FAIL] Reloading web server configuration: lighttpd failed!

我想打开 /home/user/www/project_name; 当有人打开我的网站时;像这样:www.mysite.com/project_name,所以我在 /etc/lighttpd/conf-available/10-userdir.conf 上做了以下更改

## The userdir module provides a simple way to link user-based directories into
## the global namespace of the webserver.
##
# /usr/share/doc/lighttpd/userdir.txt

server.modules      += ( "mod_userdir" )

## the subdirectory of a user's home dir which should be accessible
## under http://$host/~$user
userdir.path         = "/www/project_name/public_html"

## The users whose home directories should not be accessible
userdir.exclude-user = ( "root", "postmaster" )

以下是 /var/log/lighttpd/error.log 文件的输出。

2013-09-29 10:25:57: (log.c.166) server started 2013-09-29 10:44:57: (server.c.1430)     [note] graceful shutdown started 
2013-09-29 10:44:57: (log.c.166) server started 
2013-09-29 10:44:57:(mod_fastcgi.c.977) bind failed for: unix:/var/run/php5-fpm.sock-0 Permission denied         
2013-09-29 10:44:57: (mod_fastcgi.c.1397) [ERROR]: spawning fcgi failed. 
2013-09-29 10:44:57: (server.c.964) Configuration of plugins failed. Going down. 
2013-09-29 10:44:57: (server.c.1546) server stopped by UID = 0 PID = 5841 
2013-09-29 12:59:58: (log.c.166) server started 
2013-09-29 12:59:58: (mod_fastcgi.c.977) bind failed for: unix:/var/run/php5-fpm.sock-0 Permission denied         
2013-09-29 12:59:58: (mod_fastcgi.c.1397) [ERROR]: spawning fcgi failed. 
2013-09-29 12:59:58: (server.c.964) Configuration of plugins failed. Going down.

我无法解决问题并寻找解决方案。

php-fpm
  • 1 个回答
  • 1755 Views
Martin Hope
Pradeep Gupta
Asked: 2013-09-22 11:00:52 +0800 CST

当试图做 ldapadd 得到这个错误 ldap_add: No such object (32)

  • 4

我的 slapd.conf 中有以下条目

#######################################################################
# ldbm and/or bdb database definitions
#######################################################################
#backend        hdb
database    bdb
suffix      "dc=example,dc=com"
checkpoint  1024 15
rootdn      "cn=Manager,dc=example,dc=com"
rootpw      {SSHA}xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
directory   /var/lib/ldap
index objectClass   eq,pres


######################################################################

database monitor

access to *
        by dn.exact="gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth" read
        by dn.exact="cn=Manager,dc=example,dc=com" read
        by * none

当我尝试编写以下命令时

ldapadd -x -W -D "cn=Manager,dc=example,dc=com" -f ldapuser100.ldif

我收到以下错误:

adding new entry "uid=ldapuser100,ou=People,dc=example,dc=com"
ldap_add: No such object (32)

以下是调试:

oc_check_allowed type "structuralObjectClass"
bdb_dn2entry("uid=ldapuser100,ou=people,dc=example,dc=com")
=> bdb_dn2id("dc=example,dc=com")
<= bdb_dn2id: get failed: DB_NOTFOUND: No matching key/data pair found (-30988)
bdb_add: parent does not exist
 send_ldap_result: conn=1 op=1 p=3
send_ldap_response: msgid=2 tag=105 err=32
ber_flush2: 22 bytes to sd 12
conn=1 op=1 RESULT tag=105 err=32 text=
connection_get(12): got connid=1
connection_read(12): checking for input on id=1
ber_get_next
ber_get_next: tag 0x30 len 5 contents:
op tag 0x42, time 1379789891
ber_get_next
conn=1 op=2 do_unbind
conn=1 op=2 UNBIND
connection_close: conn=1 sd=12
conn=1 fd=12 closed

我的 LDIF 文件的内容:

dn: uid=ldapuser100,ou=People,dc=example,dc=com
uid: ldapuser100
cn: ldapuser100
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: shadowAccount
userPassword: {crypt}xxxxxxxxxxxxxxxxxxxxxxx
shadowLastChange: 15969
shadowMin: 0
shadowMax: 99999
shadowWarning: 7
loginShell: /bin/bash
uidNumber: 1400
gidNumber: 1400
homeDirectory: /exports/ldapuser100

我现在该怎么办?

openldap
  • 1 个回答
  • 18235 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