authorized-keys

Having trouble with ssh and authorized_keys

醉酒当歌 提交于 2019-12-23 03:06:57
问题 I am ssh-ing from server1 to server2 . I generated the id_rsa & id_rsa.pub files. If I ssh to mike@server2 it works fine, but ssh to john@server2 does not work without password. Both mike & john home directories contain ".ssh" which is chmod 700 and that folder contains "authorized_keys" containing only the contents of the id_rsa.pub file generated previously (and is chmod 600). Contents of both are the same. Server 1: Linux x86_64 x86_64 x86_64 GNU/Linux Server 2: AIX 5.3.0.0 64-bit Command

Is it possible to use Ansible authorized_key exclusive with multiple keys?

江枫思渺然 提交于 2019-12-10 02:11:54
问题 I'm fairly new in using Ansible and have been reading here and google and haven't found an answer yet. My scenario is that I have 1 user on a server but 2-3 different pub keys that need to put in it's authorized_keys file. I can successfully remove all keys, or add all keys with this script: --- - hosts: all tasks: - name: update SSH keys authorized_key: user: <user> key: "{{ lookup('file', item) }}" state: present #exclusive: yes with_fileglob: - ../files/pub_keys/*.pub With the present flag

Setting ssh public keys on Docker image

妖精的绣舞 提交于 2019-12-09 18:34:06
问题 I setup a Docker image that supports ssh. No problem, lots of examples. However, most examples show setting a password using passwd. I want to distribute my image. Having a fixed password, especially to root, seems like a gaping security hole. Better, to me, is to setup the image with root having no password. When a user gets the image they would then copy their public ssh file to the image /root/.ssh/authorized_keys file. Is there a recommended way to do this? Provide a Dockerfile that

Amazon AWS EC2 Deleted Key Locked out of Root

给你一囗甜甜゛ 提交于 2019-12-08 02:56:17
问题 I am running an Ubuntu instance on Amazon AWS EC2. I have a root user named ubuntu. I also have another user named ellis. My ubuntu user is the administrative user that has the control of all other users and creating files and directories in the root. When I was copying the .ssh/authorized_keys from /home/ubuntu/.ssh/authorized_keys to /home/ellis/.ssh I must have accidentally deleted the directory .ssh that was within ubuntu. Now, I am not able to login to my instance as ubuntu, only as

Having trouble with ssh and authorized_keys

[亡魂溺海] 提交于 2019-12-06 16:39:00
I am ssh-ing from server1 to server2 . I generated the id_rsa & id_rsa.pub files. If I ssh to mike@server2 it works fine, but ssh to john@server2 does not work without password. Both mike & john home directories contain ".ssh" which is chmod 700 and that folder contains "authorized_keys" containing only the contents of the id_rsa.pub file generated previously (and is chmod 600). Contents of both are the same. Server 1: Linux x86_64 x86_64 x86_64 GNU/Linux Server 2: AIX 5.3.0.0 64-bit Command 1, User Mike (works with no password): ssh -v -n -o StrictHostKeychecking=no -o NumberOfPasswordPrompts

Is it possible to use Ansible authorized_key exclusive with multiple keys?

雨燕双飞 提交于 2019-12-05 00:42:39
I'm fairly new in using Ansible and have been reading here and google and haven't found an answer yet. My scenario is that I have 1 user on a server but 2-3 different pub keys that need to put in it's authorized_keys file. I can successfully remove all keys, or add all keys with this script: --- - hosts: all tasks: - name: update SSH keys authorized_key: user: <user> key: "{{ lookup('file', item) }}" state: present #exclusive: yes with_fileglob: - ../files/pub_keys/*.pub With the present flag it reads and adds all the keys. With the absent flag it removes all keys listed. Problem is that I

Setting ssh public keys on Docker image

我与影子孤独终老i 提交于 2019-12-04 10:29:31
I setup a Docker image that supports ssh. No problem, lots of examples. However, most examples show setting a password using passwd. I want to distribute my image. Having a fixed password, especially to root, seems like a gaping security hole. Better, to me, is to setup the image with root having no password. When a user gets the image they would then copy their public ssh file to the image /root/.ssh/authorized_keys file. Is there a recommended way to do this? Provide a Dockerfile that builds on my image with an ADD command that user can edit? Provide a shell script that runs something like

How to add RSA key to authorized_keys file?

冷暖自知 提交于 2019-12-03 01:34:12
问题 I've created an RSA public key and I want to add that to authorized_keys file, but there is no such file in my Ubuntu 11.10 machine. How can I add the key to authorized_keys ? 回答1: Make sure when executing Michael Krelin's solution you do the following cat <your_public_key_file> >> ~/.ssh/authorized_keys Note the double > without the double > the existing contents of authorized_keys will be over-written (nuked!) and that may not be desirable 回答2: mkdir -p ~/.ssh/ To overwrite authorized_keys

How to add RSA key to authorized_keys file?

泄露秘密 提交于 2019-12-02 15:03:41
I've created an RSA public key and I want to add that to authorized_keys file, but there is no such file in my Ubuntu 11.10 machine. How can I add the key to authorized_keys ? donden1 Make sure when executing Michael Krelin's solution you do the following cat <your_public_key_file> >> ~/.ssh/authorized_keys Note the double > without the double > the existing contents of authorized_keys will be over-written (nuked!) and that may not be desirable Michael Krelin - hacker mkdir -p ~/.ssh/ To overwrite authorized_keys cat <your_key >~/.ssh/authorized_keys To append to the end of authorized_keys cat

git push returns “fatal: protocol error: bad line length character”

我与影子孤独终老i 提交于 2019-11-28 11:02:56
问题 I set up a remote Git repository on a shared host account I own. To allow another developer to push/pull, I added his public key (id_rsa.pub) to the end of .ssh/authorized_keys on the shared host. Then he was able to do "git push". But I want to make sure that he cannot do anything else on my shared host but access git, so I added this to the beginning of his entry in authorized_keys, according to man authorized_keys: command="/usr/bin/git",no-port-forwarding,no-agent-forwarding,no-X11