2014年10月6日 星期一

ssh

#產生ssh key
ssh-keygen -t rsa

#ssh連線
ssh 使用者名稱@提供com
ex:ssh example@example.com

#ssh連線紀錄清除
由於ssh會紀錄ssh-key導致機器mac不同時,將無法進行第二次同ip連線,得進行清除
ssh-keygen -R 127.0.0.1

//打洞
$ ssh -R [link port]:[本機port] [掛載在哪個程式伺服器底下]
$ ssh -R 31000:localhost:8000 ubuntu@220.228.145.219


#將伺服器程式建立捷徑到本機mount
sshfs -o allow_other 使用者名稱@提供com:伺服器登入後個人絕對位置 本機端位置/  
(範例)//需在建立捷徑資料夾上層
ex:sshfs -o allow_other user@test.com:/home/username/file_dir localhost_dir/  


#解除本機端sshfs路徑
nmount 本機端資料夾/
(範例)//需在解除捷徑資料夾上層
ex:umount -f localhost_dir/  

沒有留言:

張貼留言