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

ali haider's questions

Martin Hope
ali haider
Asked: 2018-04-02 17:31:33 +0800 CST

fail2ban 无法在 ubuntu 16 上启动

  • 0

我在 ubuntu 16 上安装了 fail2ban,我也有 ufw。我将 jail.conf 复制到 /etc/fail2ban 中的 jail.local。在此之后,我尝试启动 fail2ban,但在日志中出现以下错误(使用命令systemctl status fail2ban.service):

fail2ban.service: Control process exited, code=exited status=255
abcdefgh systemd[1]: Failed to start Fail2Ban Service.
fail2ban.service: Unit entered failed state.

关于如何进一步解决此问题的任何想法?

更新 我对 jail.conf 文件所做的更改是针对 sshd 部分的:

[sshd]
enabled = true
port = valid-ssh-port (this is a number but not the default port)
filter = sshd
logpath = /var/log/auth.log
maxretry = 5
fail2ban
  • 1 个回答
  • 963 Views
Martin Hope
ali haider
Asked: 2017-11-12 16:00:53 +0800 CST

使用 SSL 证书更新 OpenLDAP

  • 2

我正在使用以下命令和脚本来获取 OpenLDAP(在 ubuntu v16 上运行)以使用 SSL 证书(证书的位置正确)。

ssl.ldif

dn: cn=config
changetype: modify
add: olcTLSCACertificateFile
olcTLSCACertificateFile: /etc/ssl/certs/fullchain-xxxxxx.pem
-
add: olcTLSCertificateFile
olcTLSCertificateFile: /etc/ssl/certs/cert-xxxxxx.pem
-
add: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: /etc/ssl/private/privkey-xxxxxx.pem

命令:

sudo ldapmodify -H ldapi:// -Y EXTERNAL -f ssl.ldif

输出:

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
modifying entry "cn=config"
ldap_modify: Other (e.g., implementation specific) error (80)

是否有任何其他日志文件条目可以检查以进一步解决此问题?

openldap
  • 1 个回答
  • 1908 Views
Martin Hope
ali haider
Asked: 2016-12-03 10:57:36 +0800 CST

使用 certbot 更新 gitlab 的 ssl 证书 & 让我们加密

  • 0

我在 ubuntu 14 上运行 gitlab。之前配置的证书已过期(没有设置 cron 条目以进行续订)。我正在尝试设置 certbot(让我们加密)来更新证书,然后设置 crontab 条目以进行自动更新。当我运行 certbot 时,我收到一条复制到下面的消息(是否有可以获取更详细错误消息的位置):

正在运行的命令:

./certbot-auto certonly --webroot -w /opt/gitlab/ssl -d git.xyz.com

git.xyz.com 是一个有效的域(我用 xyz 替换了实际的域)。目录 /opt/gitlab/ssl 存在,并且用于运行命令的用户对该目录及其内容具有读/写权限。

错误 授权过程失败。git.xyz.com (http-01): urn:acme:error:connection :: 服务器无法连接到客户端验证域 :: 无法连接到 git.xyz.com

重要笔记:

- The following errors were reported by the server:

   Domain: git.xyz.com
   Type:   connection
   Detail: Could not connect to git.xyz.com

   To fix these errors, please make sure that your domain name was
   entered correctly and the DNS A record(s) for that domain
   contain(s) the right IP address. Additionally, please check that
   your computer has a publicly routable IP address and that no
   firewalls are preventing the server from communicating with the
   client. If you're using the webroot plugin, you should also verify
   that you are serving files from the webroot path you provided.  

关于如何更好地调试此问题的任何想法?

忘了提:我可以从外部网络访问 URL(域名是正确的),目前没有配置防火墙来阻止端口 80/443 上的流量(我什至关闭了防火墙进行测试)。

gitlab certbot lets-encrypt ubuntu-14.04
  • 1 个回答
  • 953 Views
Martin Hope
ali haider
Asked: 2016-10-05 07:24:55 +0800 CST

端口 80 上的 hhvm 绑定阻止 nginx 在该端口上绑定

  • 1

我在 ubuntu14 上使用以下 server.ini 配置运行 hhvm:

服务器.ini

; php options

pid = /var/run/hhvm/pid

; hhvm specific 

;hhvm.server.port = 9000
hhvm.server.file.socket=/var/run/hhvm/hhvm.sock
hhvm.server.type = fastcgi
hhvm.server.default_document = index.php
hhvm.log.use_log_file = true
hhvm.log.file = /var/log/hhvm/error.log
hhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc

我注释掉了 9000 端口行并添加了文件套接字选项。在此更改之后,当我重新启动服务时,hhvm 似乎也绑定在端口 80 上(我试图在端口 80 上运行 nginx)。我找不到任何明确绑定在端口 80 上的 hhvm 配置。关于如何确保 hhvm 不使用端口 80 的任何想法。

php.ini

; php options
session.save_handler = files
session.save_path = /var/lib/hhvm/sessions
session.gc_maxlifetime = 1440

; hhvm specific 
hhvm.log.level = Warning
hhvm.log.always_log_unhandled_exceptions = true
hhvm.log.runtime_error_reporting_level = 8191
hhvm.mysql.typed_results = false

我也没有在 /var/run/hhvm 中看到 hhvm.sock。

更新 当我评论吹捧文件套接字并将其替换为端口时,hhvm 绑定到端口 9000 而不是 80。我需要找出将 hhvm 与 nginx 一起使用的正确方法(允许 nginx 在端口 80 上运行)

php nginx php5 hhvm
  • 2 个回答
  • 156 Views
Martin Hope
ali haider
Asked: 2016-09-30 10:28:19 +0800 CST

无法通过 apt 在 debian (jessie) 上安装 hhvm

  • 0

我正在尝试使用下面的说明设置 hhvm,但我收到下面复制的错误。如果它不起作用,我将简单地克隆 git repo 并运行 make,但如果可能的话,我不希望这样做。

debian 发行版是 jessie:

lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.4 (jessie)
Release:    8.4
Codename:   jessie

hhvm 的说明

wget -O - http://dl.hhvm.com/conf/hhvm.gpg.key | sudo apt-key add -
echo deb http://dl.hhvm.com/debian jessie main | sudo tee /etc/apt/sources.list.d/hhvm.list
sudo apt-get update
sudo apt-get install hhvm

错误:

W: Failed to fetch http://dl.hhvm.com/ubuntu/dists/jessie/main/binary-i386/Packages  404  Not Found [IP: 140.211.166.134 80]

关于如何解决这个问题的任何想法?

ubuntu php apt debian-jessie hhvm
  • 1 个回答
  • 307 Views
Martin Hope
ali haider
Asked: 2016-08-28 10:30:03 +0800 CST

无法在亚马逊 AWS 中创建密钥对

  • 3

我将用户添加到亚马逊 AWS 的组中。用户有权添加 EC2 实例,但似乎没有创建密钥对的权限 - 请求被拒绝。关于需要添加什么权限才能为新用户启用此功能的任何想法?

amazon-ec2 amazon-vpc
  • 2 个回答
  • 1206 Views
Martin Hope
ali haider
Asked: 2016-08-01 13:07:48 +0800 CST

无法在 ubuntu 14 服务器上运行 certbot 进行加密

  • 0

我已经让我们在 ubuntu 服务器(python v2.7.6)上进行加密,但它不再运行抱怨我使用的是旧客户端。我下载了 ubuntu 14 的 certbot 客户端,但是当我运行以下命令时,我收到下面复制的错误 - 关于如何进一步解决此问题的任何想法:

./certbot-auto certonly --text --webroot -w /usr/share/nginx/html -d actualurl.com --keep-until-expiring --expand --agree-tos --email [email protected]


2016-07-31 20:50:48,178:DEBUG:certbot.plugins.selection:Selected authenticator <certbot.plugins.webroot.Authenticator object at 0x7f45863102d0> 
and installer None
2016-07-31 20:50:48,350:DEBUG:root:Sending GET request to https://acme-v01.api.letsencrypt.org/directory284. args: (), kwargs: {}
2016-07-31 20:50:48,354:INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): acme-v01.api.letsencrypt.org
2016-07-31 20:50:48,803:DEBUG:requests.packages.urllib3.connectionpool:"GET /directory284 HTTP/1.1" 404 19
2016-07-31 20:50:48,805:DEBUG:root:Received <Response [404]>. Headers: {'Content-Length': '19', 'X-Content-Type-Options': 'nosniff', 'Boulder-Re
quest-Id': 'gH76WSwBJgzedpyjF8X3TAVVYz0-TLkaiNGTjQa3Weg', 'Expires': 'Sun, 31 Jul 2016 20:50:48 GMT', 'Server': 'nginx', 'Connection': 'keep-ali
ve', 'Pragma': 'no-cache', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Date': 'Sun, 31 Jul 2016 20:50:48 GMT', 'Content-Type': 'text/plai
n; charset=utf-8'}. Content: '404 page not found\n'
2016-07-31 20:50:48,805:DEBUG:acme.client:Received response <Response [404]> (headers: {'Content-Length': '19', 'X-Content-Type-Options': 'nosni
ff', 'Boulder-Request-Id': 'gH76WSwBJgzedpyjF8X3TAVVYz0-TLkaiNGTjQa3Weg', 'Expires': 'Sun, 31 Jul 2016 20:50:48 GMT', 'Server': 'nginx', 'Connec
tion': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'max-age=0, no-cache, no-store', 'Date': 'Sun, 31 Jul 2016 20:50:48 GMT', 'Content-T
ype': 'text/plain; charset=utf-8'}): '404 page not found\n'
2016-07-31 20:50:48,806:DEBUG:certbot.main:Exiting abnormally:
Traceback (most recent call last):
  File "/root/.local/share/letsencrypt/bin/letsencrypt", line 11, in <module>
    sys.exit(main())
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/main.py", line 744, in main
    return config.func(config, plugins)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/main.py", line 550, in obtain_cert
    le_client = _init_le_client(config, auth, installer)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/main.py", line 360, in _init_le_client
    acc, acme = _determine_account(config)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/main.py", line 345, in _determine_account
    config, account_storage, tos_cb=_tos_cb)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/client.py", line 118, in register
    acme = acme_from_config_key(config, key)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/certbot/client.py", line 42, in acme_from_config_key
    return acme_client.Client(config.server, key=key, net=net)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/client.py", line 63, in __init__
    self.net.get(directory).json())
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/client.py", line 631, in get
    self._send_request('GET', url, **kwargs), content_type=content_type)
  File "/root/.local/share/letsencrypt/local/lib/python2.7/site-packages/acme/client.py", line 578, in _check_response
    raise errors.ClientError(response)
ClientError: <Response [404]>

我也用 certonly 运行了 certbot-auto,但我得到了同样的错误。

对话版

Version: 1.2-20130928

lsb_release -a

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.3 LTS
Release:    14.04
Codename:   trusty

我下载了 certbot 使用

wget https://dl.eff.org/certbot-auto

此外,nginx 进程正在运行,并且仍然拥有较旧的 let 加密证书。从那以后,我尝试删除它并重新启动 nginx,但我仍然遇到同样的错误。我在端口 80 上运行 HA 代理并重定向到 Nginx。

我安装了以下 certbot 插件:

* apache
Description: Apache Web Server - Alpha
Interfaces: IAuthenticator, IInstaller, IPlugin
Entry point: apache = certbot_apache.configurator:ApacheConfigurator

* webroot
Description: Place files in webroot directory
Interfaces: IAuthenticator, IPlugin
Entry point: webroot = certbot.plugins.webroot:Authenticator

* standalone
Description: Automatically use a temporary webserver
Interfaces: IAuthenticator, IPlugin
Entry point: standalone = certbot.plugins.standalone:Authenticator
certbot lets-encrypt
  • 2 个回答
  • 930 Views
Martin Hope
ali haider
Asked: 2016-04-05 08:49:41 +0800 CST

亚马逊 EC2 网络连接设置

  • 0

我在亚马逊 VPC(相同区域/可用区)上有两个虚拟机 - 它们具有相同的 VPC 和子网 ID。我应该能够使用从一个虚拟机到另一个虚拟机的私有 IP 地址(按原样)还是我需要采取额外的步骤来实现这一点(假设安全组/ufw 没有阻止我正在使用的端口的流量连通性)。

amazon-ec2
  • 2 个回答
  • 34 Views
Martin Hope
ali haider
Asked: 2016-01-23 07:42:30 +0800 CST

如何更改让我们加密的管理员电子邮件?

  • 29

我们开始使用 let's encrypt 时用作管理员电子邮件的电子邮件地址需要修改(一位前员工使用他的个人电子邮件地址作为管理员电子邮件,他不再在公司工作)。需要采取哪些步骤来进行修改(我们可以让前员工确认这一点)。我们需要删除他的个人电子邮件地址并用新的电子邮件地址替换它。这将用于密钥恢复操作。无论哪种情况,我都希望删除前员工的个人电子邮件地址。我需要采取哪些步骤来完成此操作(如果我对过程的理解不正确,请指出正确的方向)。提前致谢。

lets-encrypt
  • 5 个回答
  • 34359 Views
Martin Hope
ali haider
Asked: 2015-11-25 15:52:13 +0800 CST

使用 ssh 时获得权限被拒绝

  • 1

我正在尝试使用密钥设置 ssh 访问 - 我已将我的公钥添加到服务器上的 .ssh 目录中。我也重新启动了服务器上的 ssh 服务。当我从本地计算机登录到服务器时,我收到一条拒绝消息(复制如下 - 使用 v 标志)。我从问题中替换了用户名和 IP 地址。知道我可能做错了什么吗?

ssh -v [email protected]
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to xxx.xxx.xxx.xxx [xxx.xxx.xxx.xxx] port 22.
debug1: Connection established.
debug1: identity file /home/user/.ssh/id_rsa type 1
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/user/.ssh/id_ed25519 type -1
debug1: identity file /home/user/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3
debug1: match: OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3 pat OpenSSH_6.6.1* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr [email protected] none
debug1: kex: client->server aes128-ctr [email protected] none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ECDSA dd:e7:a3:31:60:21:c5:90:24:b5:11:65:43:d8:cd:a0
debug1: Host 'xxx.xxx.xxx.xxx' is known and matches the ECDSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:1
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/user/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/user/.ssh/id_dsa
debug1: Trying private key: /home/user/.ssh/id_ecdsa
debug1: Trying private key: /home/user/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
ssh
  • 2 个回答
  • 2846 Views
Martin Hope
ali haider
Asked: 2015-10-21 08:56:23 +0800 CST

在 ubuntu 14 上运行 apt-get update 时出错

  • 14

我在我的一台服务器上运行 ubuntu 14。

当我运行 sudo apt-get update 时,我收到以下错误。

W: GPG error: http://cran.rstudio.com trusty/ Release: The following signatures were invalid: KEYEXPIRED 1445181253 KEYEXPIRED 1445181253 KEYEXPIRED 1445181253

我应该修改我的 ppa 存储库列表还是采取其他措施来解决此问题。

更新: 我尝试使用从服务器中删除 R

sudo apt-get --purge remove r-base
sudo apt-get --purge remove r-base-core
sudo apt-get --purge remove r-base-recommended

但是,我仍然看到与 apt-get update 相同的问题。

ubuntu-14.04
  • 5 个回答
  • 9530 Views
Martin Hope
ali haider
Asked: 2013-12-13 09:42:25 +0800 CST

使用单个 nginx 服务器来服务/代理 PHP、Python 和 NodeJS

  • 1

我试图弄清楚如何最好地使用 Nginx 作为代理来服务 PHP(通过 PHP5-FPM)、Python(通过 gunicorn)和 NodeJS。我在站点可用目录中的当前默认文件复制如下。我是否应该尝试配置多个服务器或进行其他更改以启用此功能?提前致谢。

更新: 目前,使用当前配置,Nginx 充当 NodeJS 应用程序的代理。但是,它不再提供 PHP 内容。我是否应该在默认文件中使用不同的服务器,如果是这样,我是否应该能够使用相同的侦听端口但只使用不同的 server_name 并使用位置标签来区分请求?

我正在尝试将某些 URL 请求路由到 PHP 应用程序(在 /var/www - 我从 /usr/share/nginx 切换)以及 Python 和 Nodejs 后端。

我还没有实现的一种想法是尝试多个上游并在主服务器中设置 PHP - 这是否可行,即有一个用于 NodeJS 的上游,一个用于 Python,然后是用于 PHP 的服务器。

upstream test {
        server 0.0.0.0:3002;
        keepalive 500;
}


server {
        listen 81 default_server;
        listen [::]:81 default_server; ##remove this?

        root /var/www/;  ##switched from /usr/share/nginx
        index index.php index.html index.htm;

        server_name localhost; 

        location / {
                proxy_redirect off;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header Host $http_host;
                proxy_set_header X-Nginx-Proxy true;
                proxy_set_header Connection "";
                proxy_http_version 1.1;
                proxy_pass http://0.0.0.0:3002;
        }

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

        # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
        location /RequestDenied {
                proxy_pass http://127.0.0.1:4242;
        }

        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
        #       fastcgi_pass 127.0.0.1:9000;
        #       # With php5-fpm:
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }
}


# another virtual host using mix of IP-, name-, and port-based configuration
#
server {
        listen 82;
        root /var/www/;
        index index.php index.html index.htm;
        server_name php;
        location ~ /testPHP {    //testPHP is part of URL/directory name in /var/www/
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }

        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
        }

}
nginx
  • 2 个回答
  • 4506 Views
Martin Hope
ali haider
Asked: 2013-12-11 13:55:21 +0800 CST

HA 代理无法在 Ubuntu 13 上启动

  • 5

我正在尝试通过 sudo 在 ubuntu 13 VM 上启动 HA 代理 1.4.24。我的 haproxy.cfg 文件复制如下。但是,当我使用sudo service haproxy start或尝试sudo /etc/init.d/haproxy start 时,进程无法启动。有关故障排除的任何想法都会有所帮助。配置文件似乎通过了配置测试(sudo haproxy -f haproxy.cfg -c导致“配置文件有效”)。
此外, /etc/init.d 中 haproxy 文件中的Enabled标志设置为 1。端口 80 似乎没有被任何其他服务绑定。

更新: 我在 /etc/init.d/haproxy 文件中将启用标志设置为 1,而不是在 /etc/default/haproxy 文件中 - 修复此更改允许我正常运行 haproxy。

global
    maxconn     25000 # Total Max Connections. This is dependent on ulimit
    daemon
    nbproc      4 # Number of processing cores. Dual Dual-core Opteron is 4 cores for example.

defaults
    mode        http
    clitimeout  60000
    srvtimeout  30000
    contimeout  4000
    timeout http-request 5s  # added to tackle slow http requests
        option abortonclose
        option forwardfor


listen  http_proxy *:80
        #bind *:80
    balance roundrobin # Load Balancing algorithm
    option httpchk
    option forwardfor # This sets X-Forwarded-For
        default_backend bk_web

# Dynamic part of the application
backend bk_web
    ## Define your servers to balance
    balance roundrobin ## change to URL hashing
    cookie MYSRV insert indirect nocache  ## check this NOTE TO SELF
    server server1 0.0.0.0:81 weight 1 maxconn 512 check
    server server2 0.0.0.0:82 weight 1 maxconn 512 check
haproxy
  • 1 个回答
  • 3625 Views
Martin Hope
ali haider
Asked: 2013-01-29 10:18:03 +0800 CST

新用户无法连接到亚马逊 aws 上的 gitolite/git

  • 2

这些是我在亚马逊 aws 上托管的 gitolite 上设置新用户时遵循的步骤: 1. 安装的 gitolite(有效 - 我可以作为管理员连接并添加新的回购/用户)

  1. 我在 gitolite-admin 的 conf 文件中添加了一个测试 repo 和一个新用户。

  2. 新用户创建了一个名为 newUser 的新 ssh 密钥 - newUser.pub 已添加到 gitolite-admin 中的 keydir

  3. 新用户可以使用用于 Amazon 实例的证书通过 ssh 连接到 Amazon AWS 实例

  4. 我运行了以下命令:

    git add -A git commit -m '添加新的 repo 和用户' git push origin master

响应中提到已经生成了新用户和回购协议。但是,当用户连接时,ssh 无法进行身份验证。我为 git 实例运行了 ssh -vvv,即 ssh -vvv git@server name(其中服务器名称是 amazon 实例)。我可以看到 ssh 尝试没有选择新的公钥,而是尝试使用旧的 id_rsa.pub 文件。我现在将尝试强制 ssh 使用新密钥 - 任何其他有助于解决此问题的建议将不胜感激!

编辑:感谢@VonC 的回复。我已经为下面的用户复制了授权密钥信息:

command="/usr/share/gitolite/gl-auth-command adavid",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa keyinfo [email protected]

其中 adavid 是添加的用户,abcdavid 是用户计算机上的用户 ID,192.168.1.3 是用户计算机的本地地址。

第二次编辑:

我还让用户添加了一个配置文件:

Host test.git.com
HostName amazon host name
User adavid (where adavid is the user name)
PreferredAuthentications publickey
IdentityFile ~./ssh/adavid   (where adavid is the user name and associated with the key called adavid)

克隆到 git repo 时收到以下错误:

Cloning into git repository name
tilde_expand_filename: No such user .
fatal: The remote end hung up unexpectedly

我现在正在检查 git 命令,看看我是否犯了任何错误。谢谢

git
  • 1 个回答
  • 794 Views
Martin Hope
ali haider
Asked: 2013-01-22 14:52:32 +0800 CST

用户无法连接到 git(在 ubuntu 上使用 gitolite)

  • 4

我能够运行以下命令:

git clone admin@ip address:gitolite-admin.git

当我尝试使用以下步骤添加新用户时,新用户无法连接:

到目前为止采取的步骤:

1.  Copied the public key into the keydir (also tried copying it in a separate directory within the keydir)
2.  I added a repo in the config file for the new userID
3.  git add -A
4.  git commit -m 'adding new user keys and repo'
5.  git push origin master

所有这些命令运行时不会抛出任何错误。
当用户尝试登录时,他无法使用以下命令进行连接:

git clone username@IPAddress:newRepoName.git

连接超时抱怨无法连接到端口 22。任何有助于解决此问题的建议(用户的公钥是从他的计算机生成的 - 同一台计算机用于作为用户登录 - 不同的计算机用于管理员访问). 提前致谢

编辑:我删除了一个(非管理员)用户的公钥,运行提交并推送到服务器,之后我为用户添加了一个新的公钥,运行添加,提交并推送到服务器。管理员的回复提到用户已添加。但是,当用户尝试使用下面的命令连接到服务器时,连接尝试不成功(我可以从我的计算机克隆项目 - 其他用户不能,任何其他用户也不能,所以我猜我在配置时犯了一个错误其他用户 - 任何想法都非常受欢迎,感谢您的耐心等待)

git clone [email protected]:testProject 克隆到“testProject”...权限被拒绝(公钥)。fatal: 远端意外挂断

git
  • 3 个回答
  • 3863 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