Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hexo d must enter pwd | hexo deploy的时候一直需要输入密码 #175

Open
macreee opened this issue Mar 10, 2020 · 4 comments
Open

hexo d must enter pwd | hexo deploy的时候一直需要输入密码 #175

macreee opened this issue Mar 10, 2020 · 4 comments

Comments

@macreee
Copy link

@macreee macreee commented Mar 10, 2020

预期目标

  • hexo d 不需要输入密码

Expected behavior

  • hexo d does not require a password

遇到的bug

  • 我的目录是/home/git/hexo.git

  • 我已经在./git.ssh/authorized_keys中设置了git用户的公钥

    但依旧在deploy的时候需要输入密码

    image

    因为找不到问题所在,我索性也在hexo.git/.ssh/authorized_keys中也复制了一份公钥
    image

Actual behavior

  • My directory is: /home/git/hexo.git

  • I have set the user git's publickey in ./git.ssh/authorized_keys

    but I still need password when I hexo d

    image

    I could n’t find the problem, so I simply copied a public key in
    hexo.git/.ssh/authorized_keys
    image

Environment & Settings

Node.js & npm version

v12.16.1

Your site _config.yml (Optional)

# Hexo Configuration
## Docs: https://hexo.io/docs/configuration.html
## Source: https://github.com/hexojs/hexo/

# Site
title: XX
subtitle: ''
description: ''
keywords:
author: MaCree
language: zh-CN
timezone: ''

# URL
## If your site is put in a subdirectory, set url as 'http://yoursite.com/child' and root as '/child/'
url: https://xxx.cn
root: /
permalink: :year/:month/:day/:title/
permalink_defaults:
pretty_urls:
  trailing_index: true # Set to false to remove trailing 'index.html' from permalinks
  trailing_html: true # Set to false to remove trailing '.html' from permalinks

# Directory
source_dir: source
public_dir: public
tag_dir: tags
archive_dir: archives
category_dir: categories
code_dir: downloads/code
i18n_dir: :lang
skip_render:

# Writing
new_post_name: :title.md # File name of new posts
default_layout: post
titlecase: false # Transform title into titlecase
external_link:
  enable: true # Open external links in new tab
  field: site # Apply to the whole site
  exclude: ''
filename_case: 0
render_drafts: false
post_asset_folder: false
relative_link: false
future: true
highlight:
  enable: false
  line_number: true
  auto_detect: false
  tab_replace: ''
  wrap: true
  hljs: false

# Home page setting
# path: Root path for your blogs index page. (default = '')
# per_page: Posts displayed per page. (0 = disable pagination)
# order_by: Posts order. (Order by date descending by default)
index_generator:
  path: ''
  per_page: 10
  order_by: -date

# Category & Tag
default_category: uncategorized
category_map:
tag_map:

# Metadata elements
## https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta
meta_generator: true

# Date / Time format
## Hexo uses Moment.js to parse and display date
## You can customize the date format as defined in
## http://momentjs.com/docs/#/displaying/format/
date_format: YYYY-MM-DD
time_format: HH:mm:ss
## Use post's date for updated date unless set in front-matter
use_date_for_updated: false

# Pagination
## Set per_page to 0 to disable pagination
per_page: 10
pagination_dir: page

# Include / Exclude file(s)
## include:/exclude: options only apply to the 'source/' folder
include:
exclude:
ignore:

# Extensions
## Plugins: https://hexo.io/plugins/
## Themes: https://hexo.io/themes/
theme: fluid

# Deployment
## Docs: https://hexo.io/docs/deployment.html(这个目录下已经没有文档了。。。)
deploy:
  type: git
  repo: git@1.2.3.4:/home/git/hexo.git(不是真实地址但是格式一致/just a example)
  branch: master

Hexo and Plugin version(npm ls --depth 0)

hexo-site@0.0.0 /home/macreeblog
├── hexo@4.2.0
├── hexo-deployer-git@2.1.0
├── hexo-generator-archive@1.0.0
├── hexo-generator-category@1.0.0
├── hexo-generator-index@1.0.0
├── hexo-generator-tag@1.0.0
├── hexo-render-pug@2.1.4
├── hexo-renderer-ejs@1.0.0
├── hexo-renderer-marked@2.0.0
├── hexo-renderer-stylus@1.1.0
└── hexo-server@1.0.0

Your package.json package.json

{
  "name": "hexo-site",
  "version": "0.0.0",
  "private": true,
  "scripts": {
    "build": "hexo generate",
    "clean": "hexo clean",
    "deploy": "hexo deploy",
    "server": "hexo server"
  },
  "hexo": {
    "version": "4.2.0"
  },
  "dependencies": {
    "hexo": "^4.0.0",
    "hexo-deployer-git": "^2.1.0",
    "hexo-generator-archive": "^1.0.0",
    "hexo-generator-category": "^1.0.0",
    "hexo-generator-index": "^1.0.0",
    "hexo-generator-tag": "^1.0.0",
    "hexo-render-pug": "^2.1.4",
    "hexo-renderer-ejs": "^1.0.0",
    "hexo-renderer-marked": "^2.0.0",
    "hexo-renderer-stylus": "^1.1.0",
    "hexo-server": "^1.0.0"
  }
}

Others

  • 目前手动输入密码同步正常所以就没放themes/_config.yml
  • Entering the password manually is normal
    so themes/_config.yml is not necessary
@HoshinoTouko

This comment has been minimized.

Copy link

@HoshinoTouko HoshinoTouko commented Mar 14, 2020

执行一下 $ ssh-agent -s 看看

@jiangtj

This comment has been minimized.

Copy link
Member

@jiangtj jiangtj commented Mar 15, 2020

ssh秘钥生成的时候,有输密码步骤,不填不用,填了之后每次都要输😂

@macreee

This comment has been minimized.

Copy link
Author

@macreee macreee commented Mar 16, 2020

执行一下 $ ssh-agent -s 看看
输出是这个:
SSH_AUTH_SOCK=/tmp/ssh-WHGd29QdyaLb/agent.19287; export SSH_AUTH_SOCK;
SSH_AGENT_PID=19288; export SSH_AGENT_PID;
echo Agent pid 19288;

@macreee

This comment has been minimized.

Copy link
Author

@macreee macreee commented Mar 16, 2020

ssh秘钥生成的时候,有输密码步骤,不填不用,填了之后每次都要输😂

那我尝试重新生成一下试试。Linux比较萌新不太懂这些,谢谢了。
——————
刚刚重新生成了一下还是不行。好蛋疼

@stevenjoezhang stevenjoezhang transferred this issue from hexojs/hexo Mar 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.