如何自動執行ssh-keygen,產生authoriz … - Linux
By Zora
at 2010-07-23T14:10
at 2010-07-23T14:10
Table of Contents
※ 引述《impossipa ()》之銘言:
: 謝謝 maxwux & chiouss 的指教
: 我在 /etc/skel/.bash_profile
: 新增:
: -----------------------------------------
: if [ ! -f ~/.ssh/authorized_keys ]; then
: mkdir ~/.ssh
: ssh-keygen -N "" -f ~/.ssh/id_rsa
: cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
: fi
: -----------------------------------------
:
: 有錯請鞭
: 推 maxwux:要寫script寫在 .bashrc或者.profile裡面 07/22 23:16
: 推 chiouss:樓上說的檔案放到 /etc/skel 會更好喔 :P 07/23 08:50
事實上/etc/skel是在新使用者被建立後才會被複製到新user的家目錄中
如果是已經建立的舊使用者
那麼就必須更改他們的家目錄中的.bash_profile
所以你加在/etc/skel/.bash_profile中
你得新增新使用者
然後再用新使用者去連線看看就知道會不會成功啦
--
: 謝謝 maxwux & chiouss 的指教
: 我在 /etc/skel/.bash_profile
: 新增:
: -----------------------------------------
: if [ ! -f ~/.ssh/authorized_keys ]; then
: mkdir ~/.ssh
: ssh-keygen -N "" -f ~/.ssh/id_rsa
: cp ~/.ssh/id_rsa.pub ~/.ssh/authorized_keys
: fi
: -----------------------------------------
:
: 有錯請鞭
: 推 maxwux:要寫script寫在 .bashrc或者.profile裡面 07/22 23:16
: 推 chiouss:樓上說的檔案放到 /etc/skel 會更好喔 :P 07/23 08:50
事實上/etc/skel是在新使用者被建立後才會被複製到新user的家目錄中
如果是已經建立的舊使用者
那麼就必須更改他們的家目錄中的.bash_profile
所以你加在/etc/skel/.bash_profile中
你得新增新使用者
然後再用新使用者去連線看看就知道會不會成功啦
--
Tags:
Linux
All Comments
Related Posts
如何自動執行ssh-keygen,產生authorized_keys
By Elizabeth
at 2010-07-22T22:49
at 2010-07-22T22:49
關於NIS問題
By Bethany
at 2010-07-22T22:31
at 2010-07-22T22:31
xterm 奇怪的字型
By Lily
at 2010-07-22T21:51
at 2010-07-22T21:51
shell-scripts的問題(把檔案輸入後修改並輸出)
By Aaliyah
at 2010-07-22T17:47
at 2010-07-22T17:47
StarDict 單字地圖
By Hamiltion
at 2010-07-22T16:05
at 2010-07-22T16:05