I/O Redirection - Linux
By Suhail Hany
at 2013-04-25T11:13
at 2013-04-25T11:13
Table of Contents
user=user
hostname=ip
port=22011
scp -P $port ~/.ssh/id_rsa.pub $user@$hostname:~/.ssh/
ssh -p $port $user@$hostname "cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys"
這段是一段簡易的製作ssh免密碼登入的shell,
但是 當第一次建立的時候,4 跟 5的程式碼,每次都要輸入密碼。
想請問是否有方式可以直接 cat ~/.ssh/id_rsa.pub 然後Redirection 到遠端的檔案?
--
hostname=ip
port=22011
scp -P $port ~/.ssh/id_rsa.pub $user@$hostname:~/.ssh/
ssh -p $port $user@$hostname "cat ~/.ssh/id_rsa.pub >> ~/.ssh/authorized_keys"
這段是一段簡易的製作ssh免密碼登入的shell,
但是 當第一次建立的時候,4 跟 5的程式碼,每次都要輸入密碼。
想請問是否有方式可以直接 cat ~/.ssh/id_rsa.pub 然後Redirection 到遠端的檔案?
--
Tags:
Linux
All Comments
By Michael
at 2013-04-27T15:50
at 2013-04-27T15:50
By Necoo
at 2013-04-30T05:02
at 2013-04-30T05:02
Related Posts
gnuplot使用問題
By David
at 2013-04-24T20:17
at 2013-04-24T20:17
ps aux | egrep '(httpd)' 顯示數量
By Zora
at 2013-04-24T15:19
at 2013-04-24T15:19
apache log檔的分析問題
By Puput
at 2013-04-24T14:03
at 2013-04-24T14:03
ubuntu 開機碟
By Madame
at 2013-04-24T00:47
at 2013-04-24T00:47
這兩天的Ubuntu更新是否有顯示卡驅動更新
By Ophelia
at 2013-04-23T15:17
at 2013-04-23T15:17