$nano /etc/ssh/sshd_config

주석처리된 PermitRootLogin Yes를 주석처리 해제 및 No로 변경

PermitRootLogin no

해당 단락(?) 밑에 AllowUser 추가 하고 접근 허락할 아이디를 써줌

#MaxAuthTries 6
#MaxSessions 10
AllowUsers admin user2 user3 user ..

저장 후 재시작

service sshd restart

 

Digital Ocean 이용중인데,  FTP 는 접속은 되나  맥에서 SSH 접속은 안되는 문제 발생


Ssh a@host 하면

connection Closed by 0.0.0.0(ip) 라는 메세지와 접속이 안됨


재부팅하니 해결은 됐으나 DigitalOcean에 해결법이 있어 메모



DigitalOcean - 계정 - Web Console 에서 해결


Log in to your droplet via the console and run these commands:
ssh-keygen -t dsa -N "" -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t rsa -N "" -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t ecdsa -N "" -f /etc/ssh/ssh_host_ecdsa_key
if that doesn't work (i.e. you still can't type /), try running this command instead:
dpkg-reconfigure openssh-server


출처 : https://www.digitalocean.com/community/questions/ssh_exchange_identification-connection-closed-by-remote-host



$nano /etc/ssh/sshd_config


열 포트번호 추가


Port 7022  


$service ssh restart


+ Recent posts