AWS VPC를 이전하면서 운영1번 서버와 운영2번 서버가 mount 되어 있었는데
서버 재기동을 하면서 umount가 되었다.
기존에는 NFS로 공유가 되어 있었는데 좀 더 보안적인 향상을 위해 sshfs를 이용하여 mount 하기로 함!
운영2번 서버에서 운영 1번 서버의 upload 파일을 연결하도록(mount)
에러 메세지 : Error:Nothing to do
https://serverfault.com/questions/423589/install-sshfs-on-amazon-linux-ami-2012-03
https://aws.amazon.com/ko/premiumsupport/knowledge-center/ec2-enable-epel/
https://spacek82.tistory.com/5
$ ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
chmod 400 ~/.ssh/id_rsa
private key는 400으로 권한을 설정한다.
pub 파일은 원격 서버에 전송한다. (scp 를 이용)
cat id_rsa.pub >> ~/.ssh/authroized_keys
sudo sshfs [원격 서버 ID]@[원격 서버 주소]:[원격서버폴더][로컬서버마운트지점] -o allow_other,nonempty,IdentityFile=[ssh개인키]
https://help.ubuntu.com/community/Fstab
사이트에 옵션에 대한 설명이 자세히 나와 있다.
allow_other
공유 설정 시 allow_other 옵션을 부여하면 공유를 설정한 계정 이외의 다른 계정도 접근이 가능하다.
$ sudo vi /etc/fuse.conf
서버가 재시작 되어도 항상 연결되어 있게 하려면 /etc/fstab 파일을 수정해 주면 된다.
관리적인 측면에서 당연히 재부팅이 될 시에 자동 mount가 되게 설정해야 하지만
여러번 시도를 해봤는데 잘 되지 않았다...
혹시 몰라 ssh key의 암호 입력을 생략하도록 sshd config 설정을 바꿨는데도 되지 않았다.
mount | grep sshfs 연결된 내용을 기반으로도 fstab 파일을 수정해봤지만 안됨
문제점 : mount는 됐지만 이미지 처럼 마운트 파일이 문제 발생
mount하는 파일이 심볼릭 링크가 설정이 되어 있는데...
아마 권한 관련된 문제 일지도... 추후에 시도해 보도록 하자...
https://kibua20.tistory.com/49
https://bepa.tistory.com/81
https://help.ubuntu.com/community/Fstab
https://prasadlinuxblog.wordpress.com/2014/01/24/linux-mount-options-autonoautousernouserexecnoexecrorwsyncasyncdefaults/
https://blog.leocat.kr/notes/2018/04/23/sshfs-mount-remote-server-using-ssh
https://hbase.tistory.com/9
https://velog.io/@tkfrn4799/Ubuntu-sshfs-%EC%84%9C%EB%B2%84-%EA%B0%84-%EA%B3%B5%EC%9C%A0-%ED%8F%B4%EB%8D%94-%EC%84%A4%EC%A0%95
https://blog.sonim1.com/226
https://www.joinc.co.kr/w/man/12/sshfs