نمایش نتایج: از شماره 1 تا 5 , از مجموع 5

موضوع: چطور یک دستور SHH را به صورت Shell Script اجرا کنیم ؟

Threaded View

پست قبلی پست قبلی   پست بعدی پست بعدی
  1. #4
    مدیر کل Vahid آواتار ها
    تاریخ عضویت
    Aug 2008
    نوشته ها
    2,724
    تشکر تشکر کرده 
    435
    تشکر تشکر شده 
    6,991
    تشکر شده در
    2,087 پست

    پیش فرض پاسخ : چطور یک دستور SHH را به صورت Shell Script اجرا کنیم ؟

    کد:
    -pasword-file=/file.txt


    ---------- Post added at 07:04 PM ---------- Previous post was at 06:54 PM ----------

    کد:
    # Identify the server that initially contains the files (we will call this the SOURCE server), and the serverto which you want to transfer the files (we will call this the TARGET server). Confirm that you can log in to the SOURCE server, that you can log in to the TARGET server, and that while logged into the TARGET server, you can use ssh to login to the SOURCE server using your password. # Step 2 Log into the TARGET server. Execute the command [mikeular@targethost~]$ ssh-keygen -t dsa ssh-keygen will ask you where you want to save the key. Accept the default directory, which will be ~/.ssh/id_dsa . Next it will ask you for a passphrase, leave this entry blank. Your private key file will be saved to ~/.ssh/id_dsa and your public key will be saved to ~/.ssh/id_dsa.pub. Careful! Anyone who obtains a copy of your id_dsa file will be able to login to the SOURCE server as you, without authenticating themselves. Make sure that it's stored securely! # Step 3 Now you will configure the SOURCE server to accept the key. Once this step is complete, anyone with the id_dsa file will be able to log into the SOURCE server without providing a password. Log into the SOURCE server and create the ssh directory: [mikeular@sourcehost~]$ mkdir ~/.ssh [mikeular@sourcehost~]$ cd ~/.ssh Using vi or another text editor, create a file in ~/.ssh named authorized_keys2 . Now switch over to the TARGET server and copy the contents of the file id_dsa.pub and paste them into authorized_keys2 on the SOURCE server. Save the text file. # Step 4 Make sure that the authorized_keys2 cannot be changed by other users on the SOURCE server: [mikeular@sourcehost~]$ chmod 644 ~/.ssh/authorized_keys2 # Step 5 Now you can test your setup. Go back to the TARGET server and connect to the source. [mikeular@targethost~]$ ssh username@sourcehost.com [mikeular@sourcehost~] Your ssh connection is now working correctly. # Step 6 Test your rsync over ssh connection by copying a file from SOURCE to TARGET. Enter the following command all on one line, being sure to substitute in the correct pathnames, username, and hostname. [mikeular@targethost~]$ rsync -avz -e/usr/bin/ssh username@sourcehost.com:/home/username/testfile /home/mikeular/ This should copy the file "testfile" from your home directory on sourcehost to your home directory on targethost. # Step 7 All that's left is to setup your cron job. Plenty of documentation is available online.
    برای پیش رفت در علم آسانسوری وجود ندارد پله ها را باید پیاده رفت /./ همیشه این یادتان باشد که دست بالای دست بسیار است.
    يادمان باشد براي يك بار ايستادن صد ها بار افتاده ايم /./ بک آپ مهمترین رمز موفقیت هاستینگ /./ امنیت مطلق نیست.
    ارتباط مستقیم با من :
    Admin -{(@)}- WebHostingTalk . ir

  2. تعداد تشکر ها ازVahid به دلیل پست مفید


اطلاعات موضوع

کاربرانی که در حال مشاهده این موضوع هستند

در حال حاضر 1 کاربر در حال مشاهده این موضوع است. (0 کاربران و 1 مهمان ها)

موضوعات مشابه

  1. پاسخ ها: 123
    آخرين نوشته: September 2nd, 2018, 22:20
  2. اجرای دستورات Shell در cp
    توسط alimooghashang در انجمن سی پنل CPanel
    پاسخ ها: 5
    آخرين نوشته: September 6th, 2010, 00:09
  3. دستورات پاک کردن shell
    توسط mohammadt در انجمن سی پنل CPanel
    پاسخ ها: 5
    آخرين نوشته: September 6th, 2010, 00:05
  4. یافتن shell script در هاست
    توسط reza63 در انجمن Proxy / Cache / Firewall
    پاسخ ها: 3
    آخرين نوشته: May 30th, 2010, 18:54

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •