u
This commit is contained in:
parent
ded2ef13c7
commit
199eac4c42
@ -43,8 +43,7 @@ then
|
||||
read -p ">>> " CopyOrLinkScripts
|
||||
for homescript in $homescriptlist
|
||||
do
|
||||
rm -fr $homescript.backup
|
||||
mv $homescript $homescript.backup
|
||||
mv $homescript $homescript.backup-[$(date +%Y%m%d-%H%M%S)]
|
||||
if [ $CopyOrLinkScripts = 'l' ]
|
||||
then
|
||||
echo "--- Linking $SourcePath/$homescript to $HomePath/$homescript ..."
|
||||
@ -62,8 +61,7 @@ then
|
||||
echo "--- Linking $SourcePath/authorized_keys to $HomePath/.ssh/authorized_keys ..."
|
||||
mkdir -p $HomePath/.ssh
|
||||
chmod 700 $HomePath/.ssh
|
||||
rm -fr $HomePath/.ssh/authorized_keys.backup
|
||||
mv $HomePath/.ssh/authorized_keys $HomePath/.ssh/authorized_keys.backup
|
||||
mv $HomePath/.ssh/authorized_keys $HomePath/.ssh/authorized_keys.backup-[$(date +%Y%m%d-%H%M%S)]
|
||||
ln -s $SourcePath/.ssh/authorized_keys $HomePath/.ssh/authorized_keys
|
||||
elif [ $CopyOrLinkOrOmitAuthorizedKeys = 'a' ]
|
||||
then
|
||||
|
@ -14,4 +14,4 @@ scp ~/.ssh/id_rsa.pub $REMOTEHOST:~/tmp.pub
|
||||
|
||||
ssh $REMOTEHOST "mkdir -p ~/.ssh && chmod 700 ~/.ssh && cat ~/tmp.pub >> ~/.ssh/authorized_keys && chmod 600 ~/.ssh/authorized_keys && rm -f ~/tmp.pub"
|
||||
|
||||
echo ~/.ssh/id_rsa.pub is appended to $REMOTEHOST:~/.ssh/authorized_keys
|
||||
echo "~/.ssh/id_rsa.pub is appended to $REMOTEHOST:~/.ssh/authorized_keys"
|
Loading…
Reference in New Issue
Block a user