I installed Docker and dokku for fun.
It is correctly works on my sub-laptop when I copy ~/.ssh/id_rsa.pub
and run sudo sshcommand acl-add dokku <nickname>
but not on my server.
I did same progress on my server, but git, ssh says require password.
So I thoght a few hours. then I relized I changed my ssh daemon’s configuration. I block all users who is not in the ssh group. so I add dokku account to ssh group and tried again. and FAILED.
Finnaly I set password to dokku account. and tried again. ssh and git works WITHOUT PASSWORD.
Maybe the ssh client has failed to login with ssh-key so ask me a password. so I opened /etc/shadow
file to find out what happened.
Only the root
and dokku
has !
on password field. and other non-password account have *
on it.
I don’t know what it is for. but it works when I changed !
to *
.
심심해서 Docker를 설치하고 dokku까지 설치해봤다.
그런데 실험삼아 서브노트북에 설치한 dokku는 ~/.ssh/id_rsa.pub
을 복사해서 sudo sshcommand acl-add dokku <nickname>
해주면 git push 명령도 잘 먹고 ssh dokku@<hostname>
해주면 정상적으로 접속이 끊기지만 서버컴에 설치한 dokku는 아무리 id_rsa.pub
파일을 집어넣어도 자꾸 패스워드를 물었다.
무슨 차이일까 가만히 생각하다가 내가 서버에는 SSH 데몬의 설정을 건드린 것이 생각났다. 특정 그룹에 있지 않으면 SSH 접속조차 막아뒀다. 그래서 dokku 계정을 ssh 그룹에 추가해줬는데도 결과는 마찬가지였다.
결국 포기하는 마음으로 dokku 계정에 패스워드를 설정하고 접속해봤다. 그런데 마법같이 패스워드를 묻지도 않고 접속이 되었다. 아마 패스워드가 없는 계정은 접속을 막았는데 클라이언트에서 ssh-key로 접속이 안되니 패스워드를 물어본 것 같다. 그래서 /etc/shadow
파일을 잠깐 열어보니 패스워드가 없는 계정은 패스워드 부분에 적힌 값이 두 가지로 나뉘어 있었다. 하나는 *
이고 하나는 !
인데 다른 계정들은 대부분 *
을 사용했는데 root와 dokku만 !
를 사용했다. 그래서 혹시나 하고 *
로 바꿔보았는데 잘 작동이 되었다.
*
과 !
의 차이를 찾아봤는데 다들 기능적으로 똑같다고만 말하고 !
는 보통 패스워드가 있던 계정을 사용 못하게 할 때, *
는 패스워드가 지정된 적이 없는 계정에 그렇게 적는다고 말한다. 하지만 dokku를 사용해보니 실제로 차이가 있었다.