gitlab查詢公鑰被哪個用戶使用

查看 /var/opt/gitlab/.ssh/authorized_keys,找到公鑰的key_id

command="/opt/gitlab/embedded/service/gitlab-shell/bin/gitlab-shell key-123",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3....k2kQ==

gitlab postgre 信息

/var/opt/gitlab/gitlab-rails/etc/database.yml
production:
  adapter: postgresql
  encoding: unicode
  collation:
  database: gitlabhq_production
  pool: 10
  username: 'gitlab'
  password:
  host: '/var/opt/gitlab/postgresql'
  port: 5432
  socket:
  sslmode:
  sslrootcert:
  sslca:

訪問postgre數據庫

su - gitlab-psql
psql -h /var/opt/gitlab/postgresql -d gitlabhq_production
  \dt
  \d <table>

# 查看所有表名
# SELECT tablename FROM pg_tables WHERE tablename NOT LIKE 'pg%' AND tablename NOT LIKE 'sql_%' ORDER BY tablename;

查詢出key綁定的user_id

select * from keys where id=<key_id>;

根據user_id查詢用戶信息

select * from users where id=<user_id>;
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章