Sunday 13 August 2017

Pilihan Trojaned Ssh Daemon Komponen Hwclock Biner


Artikel ini adalah bagian dari seri BackupYourSystem. Informasi pengantar lebih banyak dapat ditemukan di sana. Pendahuluan Dari halaman manual: Rsync adalah alat penggandaan file yang cepat dan sangat serbaguna. Ini dapat menyalin secara lokal, dari host lain di atas remote shell, atau dari daemon rsync jarak jauh. Ini menawarkan sejumlah besar pilihan yang mengendalikan setiap aspek perilakunya dan mengizinkan spesifikasi yang sangat fleksibel dari kumpulan file yang akan disalin. Hal ini terkenal dengan algoritma delta-transfer, yang mengurangi jumlah data yang dikirim melalui jaringan hanya dengan mengirimkan perbedaan antara file sumber dan file yang ada di tempat tujuan. Rsync banyak digunakan untuk backup dan mirroring dan sebagai perintah copy yang lebih baik untuk penggunaan sehari-hari. Dengan kata lain, rsync adalah alat untuk menyalin dan membuat cadangan data secara efisien dari satu lokasi (sumber) ke sumber lain (tujuan). Ini efisien karena hanya mentransfer file yang berbeda antara direktori sumber dan tujuan. Rsync adalah utilitas baris perintah. Pengguna yang mencoba menggunakannya harus terbiasa dengan command line (lihat Menggunakan Terminal). Jika Anda lebih memilih antarmuka grafis, lihat bagian Grsync dari halaman ini. Installasi Rsync di Ubuntu secara default. Pastikan untuk memeriksa apakah paket berikut telah diinstal sebelum memulai (lihat Memasang Paket): rsync, xinetd, ssh. Lakukan Backup Sederhana Metode paling sederhana untuk memback up melalui jaringan adalah dengan menggunakan rsync via SSH (menggunakan opsi - e ssh). Sebagai alternatif, Anda dapat menggunakan daemon rsync (lihat Daemon Rsync yang memerlukan konfigurasi lebih banyak. Cadangan lokal hanya memerlukan akses rsync dan readwrite ke folder yang disinkronkan. Di bawah ini Anda akan menemukan contoh perintah yang dapat digunakan untuk membuat cadangan dalam kedua kasus tersebut. Perlu dicatat, bahwa sinkronisasi jaringan dapat dilakukan secara lokal selama folder dibagi (katakanlah dengan Samba) dan kemudian dipasang ke mesin dengan folder1. Proses ini sempat harus menggunakan ssh namun kurang aman dan hanya boleh digunakan. Di jaringan pribadi yang aman, seperti di rumah Anda Backup Over Network Penjelasan opsi di atas untuk perintah: --dry-run Ini memberitahu rsync untuk tidak benar-benar melakukan apa-apa. Ini hanya akan menulis log dari apa yang akan dilakukan pada layar. Setelah Anda memastikan semuanya akan berjalan seperti yang Anda harapkan, Anda harus menghapus opsi ini, dan jalankan perintah lagi untuk melakukan backup yang sebenarnya. --delete menghapus file yang tidak ada pada sistem yang didukung. (Opsional) - sebuah pelestarian Tanggal dan t Imes, dan hak akses file (sama dengan - rlptgoD). Dengan opsi ini rsync akan: Turun secara rekursif ke semua direktori (-r), salin symlink sebagai symlink (-l), pertahankan hak akses file (-p), pertahankan waktu modifikasi (-t), pertahankan kepemilikan file (-o), dan - z memampatkan data - vv meningkatkan verbosity dari proses pelaporan - e menentukan remote shell untuk menggunakan folder1 dan folder2 Pada contoh di atas, folder1 dan 2 adalah placeholder agar direktori disinkronkan. Folder1 adalah folder asli, dan 2 adalah folder baru, atau yang sudah ada untuk dibawa sinkron dengan yang pertama. Ganti dengan folder yang Anda inginkan. A ditambahkan setelah folder1 sehingga hanya isi, bukan keseluruhan folder, akan dipindahkan ke yang kedua. Sinopsis lengkap dari semua opsi dengan perintah rsync dapat ditemukan di halaman manual di bawah Options Summary. Halaman manual untuk rsync juga dapat ditemukan di linux. die Grsync adalah antarmuka GUI untuk utilitas rsync. Antarmuka sederhana GUI memaparkan banyak opsi dasar yang tersedia dengan rsync. Hal ini berguna bagi mereka yang memilih untuk tidak menggunakan command line. Instalasi Program grsync tidak diinstal secara default di Ubuntu atau distrubtion lainnya namun mudah didapat dari Repositori utama. Untuk mendapatkan grsync memastikan bagian Universe dari repositori Ubuntu diaktifkan di Sumber Perangkat Lunak Anda. Kemudian untuk menginstal software ini di Ubuntu, instal paket berikut. Grsync Konfigurasi Untuk memulai grsync melalui menu berikut: Applications --gt System Tools --gt grsync. Setelah start up Anda akan disajikan dengan jendela utama, di mana semua konfigurasi berlangsung. Di jendela ini semua pilihan yang paling banyak pengguna butuhkan. Untuk menjelaskan, pilihan akan terdaftar dan efeknya disebutkan. Sesi - Fungsi ini sama dengan profil orang lain. Setiap sesi akan menyimpan kumpulan direktori sumber dan tujuan yang berbeda, serta opsi konfigurasi yang terkait dengan pasangan folder. Ini memungkinkan sinkronisasi kumpulan folder yang berbeda sesuai dengan pilihan yang berbeda. Pengelolaan sesi sederhana, cukup tekan tombol Add untuk menambahkan yang baru. Untuk menghapus, pilih sesi yang tidak Anda inginkan lagi dari drop down dan tekan Delete. Sumber dan Tujuan - Kedua kotak ini mencantumkan dua folder (secara teknis disebut sebagai direktori) yang akan disinkronkan. Bagian atas adalah Sumber dan bagian bawah Tujuan. Jadi saat Anda Menjalankan sinkronisasi, file dari Source akan disalin ke Destination sesuai dengan pilihan yang dipilih pengguna. Untuk menentukan direktori baik Browse for them dari GUI atau ketik sesuai dengan standar path conventions. Switch - Tanda reload universal yang berada di sebelah kanan tombol Browse adalah tombol praktis. Ini akan langsung mengaktifkan Source with the Destination. Impor dan Ekspor - Setelah sesi dikonfigurasi, pengguna mungkin ingin mencadangkannya untuk penyimpanan. Untuk melakukannya, cukup buka Menu Sesi di bagian atas dan pilih Impor atau Ekspor. Yang pertama akan mengembalikan sesi dari cadangan yang sebelumnya dibuat, yang terakhir akan membuat cadangan sesi saat ini. Catatan: Fungsi backup ini bekerja secara per sesi. Ini berarti, setiap sesi yang ingin Anda cadangkan harus dipilih dari drop down dan kemudian dicadangkan. Jika Anda memiliki 3 sesi yang berbeda, pilih masing-masing pada gilirannya dan Ekspor mereka. Sama saat sesi impor. Opsi Dasar - Sebagian besar pengguna akan menemukan sebagian besar opsi yang mereka butuhkan di sini. Empat yang pertama akan menjaga sifat file yang ditransfer. Yang lain akan memodifikasi bagaimana file disalin. Untuk informasi lebih lanjut tentang apa yang masing masing lakukan secara spesifik, arahkan kursor stasioner Anda ke atas opsi dan akan menampilkan penjelasan kecil. Pilihan yang diperiksa tentu saja adalah hal-hal yang akan diterapkan selama sesi berlangsung. Opsi Lanjutan - Tab ini menyimpan lebih banyak pilihan, banyak berguna dan cukup jelas. Bagi yang tidak mengerti, tooltips akan ditampilkan saat mouse tetap berada di atas pilihan cukup lama. Pilihan Tambahan - Kotak entri ini memungkinkan masukan pilihan tambahan yang tidak disajikan di GUI namun diketahui oleh pengguna. Penggunaan disarankan hanya untuk pengguna berpengalaman, memasukkan pilihan yang salah mungkin tidak terduga. Simulasi dan Eksekusi Dua tombol terakhir pada jendela adalah Simulation and Execute. Tombol untuk simulasi sangat berguna saat tidak pasti apa yang akan terjadi berdasarkan pilihan yang dipilih. Layar dialog transfer normal akan muncul dan di panel utama, daftar file yang akan disalin didaftarkan. Pengguna kemudian dapat memverifikasi apakah ini sesuai keinginan atau melakukan perubahan. Setelah sesi dimulai dengan tombol Execute, dialog akan muncul lagi tapi kali ini benar-benar akan memproses folder yang sesuai. Pastikan sebelum mendorong Execute bahwa Anda senang dengan simulasi. Cadangan Cadangan Jarak Jauh melalui jaringan dimungkinkan, sebaiknya pengguna memasang kembali jaringan agar didukung sebelum meluncurkan program. Saham tersebut kemudian akan terdaftar di People GUI dan dapat dengan mudah ditambahkan. Tidak ada bagian terpisah untuk jaringan, jika lebih banyak fitur canggih dibutuhkan pengguna dianjurkan untuk melihat alternatif, yang jumlahnya banyak. Alternatif Ada banyak alternatif, dalam berbagai tahap perkembangan. Untuk daftar yang tidak lengkap, lihat di sini. Rsync Daemon Daemon rsync adalah alternatif untuk SSH untuk remote backup. Meski lebih sulit dikonfigurasi, memang memberikan beberapa manfaat. Misalnya, menggunakan SSH untuk membuat cadangan jauh dari keseluruhan sistem mengharuskan daemon SSH mengizinkan login root, yang dianggap sebagai risiko keamanan. Menggunakan daemon rsync memungkinkan login root melalui SSH dinonaktifkan. Konfigurasi Daemon rsync 1. Edit file etcdefaultrsync untuk memulai rsync sebagai daemon menggunakan xinetd. Entri yang tercantum di bawah ini, harus diubah dari yang salah menjadi inetd. 2. Instal xinetd karena tidak terinstal secara default. 3. Buat file etcxinetd. drsync untuk meluncurkan rsync via xinetd. Ini harus berisi baris teks berikut. 4. Buat file konfigurasi etcrsyncd. conf untuk rsync dalam mode daemon. File harus berisi yang berikut ini. Dalam file tersebut, pengguna harus diganti dengan nama pengguna pada mesin remote yang masuk. 5. Buat etcrsyncd. secrets untuk user password. Pengguna harus sama seperti di atas, dengan password yang digunakan untuk login ke mesin remote sebagai pengguna yang ditunjukkan. 6. Langkah ini mengatur hak akses file untuk rsyncd. secrets. 7. StartRestart xinetd Jalankan perintah berikut untuk memeriksa apakah semuanya baik-baik saja. Output yang tercantum hanyalah sampel, harus ada pada mesin remote bersama Anda. Hostname bisa diganti dengan alamat IP dari mesin. Cadangan Dengan Rsync dan Ssh (gulir ke bawah jika Anda menginginkan sinopsis yang kurang informatif dari apa yang akan dibahas) Saat pertama kali mulai mengutak-atik gagasan ini, keseluruhan masalah SSH membingungkan saya, terutama karena saya tidak berpikir SSH akan mudah dilakukan. Bagi pengguna akhir untuk memanfaatkannya. Sementara SSH sangat kompleks dalam desain, mereka membuatnya sangat mudah bagi pengguna akhir untuk membuat satu set kunci otentikasi. Intinya, SSH adalah 1 sampai 1 koneksi otentik yang bisa didapat tanpa password. Setelah ini di tempat, Anda dapat menggunakan rsync untuk menjalankan secara otomatis. Sebelum kita mulai, pastikan Anda menginstal openssh-server pada server file Anda yang bersangkutan. Selanjutnya, kita perlu membuat pasangan kunci. Anda akan menerima kunci publik dan kunci pribadi. Anda akan ditanya beberapa pertanyaan, seperti apakah Anda menginginkan kata kunci untuk pasangan kunci, dll. Saya memilih tidak dan pada dasarnya membiarkan segalanya gagal. Aku pergi tanpa password karena kunci SSH cukup aman, dan ditambah lagi aku ingin ini otomatis. Saya tidak yakin bagaimana saya bisa mengotomatisasi proses ini sambil tetap memiliki kata kunci di dalamnya. Kunci publik perlu disalin ke file authorizedkeys di server. Berkat perintah praktis, ini tidak menyakitkan. Ganti jason192.168.1.150 dengan konfigurasi Anda. Ini akan meminta password anda Masukkan kata sandi Anda ke akun pengguna yang Anda kelola di file server. Setelah selesai, Anda harus dapat menjalankan: Jika tidak meminta password dan prompt Anda berubah, youre baik untuk pergi. Jika meminta kata sandi, kemungkinan ada kemungkinan. Harap dicatat, jika Anda mengacaukan dengan kunci SSH (dengan menghapusnya, menambahkan yang baru, dll.), Memerlukan reboot (beberapa orang telah memberi tahu saya bahwa saya log in log juga bekerja dengan baik) untuk mengatur ulang. Saya tidak tahu cukup banyak tentang hal itu untuk menjelaskan apa yang terjadi selain menduga terdidik bahwa kunci SSH terkunci pada sesi Anda. Kecuali Anda berencana untuk bermain-main seperti yang saya lakukan, di mana saya akan menghapus kunci SSH dan membangkitkannya berulang-ulang untuk tujuan belajar, Anda tidak akan mengalami masalah ini. Tapi jika Anda melakukannya, saya ingin membuang ini dari sana. Jadi, SSH sudah diatur dan kamu baik untuk pergi. Sekarang apa yang rsyncs gilirannya. Anda telah membuka pintu dengan SSH, sekarang Anda perlu memasukkannya ke dalam gigi dengan rsync. Rsync adalah alat sinkronisasi jarak jauh. Untuk kegunaan saya, yang cukup mengagumkan. Saya sarankan Anda membaca manual rsync untuk informasi lebih lanjut. Sekadar catatan, ada yang membaca ini yang menggunakan Linux, tolong ingatlah halaman manualnya. Mereka lebih cepat dari Google. Secara jujur. Anda bisa membacanya dengan pergi ke terminal dan mengetik rsync. Tentu saja, Anda bisa mengganti rsync untuk perintah lainnya untuk membacanya lebih banyak lagi, alias man cp dll. Halaman manual akan membahas fungsionalitas sekumpulan bendera. Ada beberapa yang saya gunakan secara pribadi dan saya sampaikan dengan kata-kata saya sendiri di bawah ini. - mode Arsip Ini menjaga waktu, izin, pemilik, kelompok, dan berbagai setting lainnya sama seperti sumbernya. Saya suka menggunakan - karena memastikan data saya di server file cocok dengan data saya di desktop, bahkan sampai ke siapa yang memiliki apa dan waktu perangko. - z mode kompresi Aku havent benar-benar digunakan ini sampai saat ini. Saya tidak yakin apakah saya melihat perbedaan karena rsync cukup cepat untuk dimulai, tapi saya melakukannya di sana, terutama karena, mengapa tidak - kecuali mode Kecualikan. Ini jika Anda ingin mengecualikan direktori, sampah, video, dll. Misalnya, katakanlah Anda ingin mengecualikan semua filefolder yang tersembunyi. Anda akan melakukan - kecuali. Perhatikan setelah tanda sama dengan ada periode dan itu memastikan youre melakukan wild card, yang berarti SEMUANYA, tapi hanya setelah periode tersebut. Karena berkas berkas yang tersembunyi dimulai dengan sebuah periode, Anda dapat melihat bagaimana hal itu termasuk. folder1.folder2.folder3, dll. Catatan - Secara pribadi, saya pasti akan merekomendasikan tidak termasuk. gvfs. Gvfs adalah sistem file virtual gnome. Ini pada dasarnya bertindak sebagai titik mount untuk sumber daya jaringan. Katakanlah file server Anda dapat diakses melalui. gvfs. Jika Anda rsync semuanya dan tidak mengecualikan. gvfs, pada dasarnya Anda menduplikat data di server file Anda yang sudah ada, karena semuanya ada di folder utamanya, dan juga melalui. gvfs berkat server file Anda. HomejasonDocuments homejasonMusic homejasonPictures homejason. gvfsDocuments homejason. gvfsMusic homejason. gvfsPictures Dengan mengecualikan. gvfs, Anda menghindari ini semua bersama-sama. Jika Anda membuat cadangan sebuah direktori home, Id menyarankan untuk melakukannya. Menggunakan hanya --exclude. gvfs bekerja untuk saya, tapi jika Anda memerlukan jalur penuh, tentu saja akan --excludehomejason. gvfs --delete Ini akan menghapus file di tempat tujuan yang tidak ada di sumbernya. Katakanlah Anda memiliki folder yang berisi data 100 GB dan data namanya saja. Jika Anda mengubah nama menjadi data2, server Anda akan berisi salinan data dan data2 sejumlah besar 200 GB. Jika Anda ingin agar data di server Anda sama, gunakan - hapus. Jika Anda ingin memiliki beberapa jenis redundansi file yang lebih tua (saya tahu beberapa orang lebih memilih ini), jangan gunakan - hapus. --progress Jika Anda menjalankan rsync secara manual, Anda akan dapat melihat kemajuan dari apa yang terjadi, bukan hanya kursor yang berkedip-kedip. Saya hanya menggunakan flag ini jika saya ingin menjalankan perintah secara manual dan melihat apa fungsinya. Saya tidak repot-repot menggunakan ini saat showtime-nya dan saya ingin otomatis di latar belakang. Selain itu, hanya tentang menyiapkan sumber dan tujuan. Mari kita mulai dengan tujuan, karena bagaimanapun, sedang bermain-main dengan SSH di sini sehingga anak laki-laki sedikit berbeda. Untuk tujuan, Anda memerlukan jalur pengguna, server, dan folder. Seperti yang saya katakan, nama saya Jason, dan server file saya adalah 192.168.1.150. Jalan folder saya di server saya khususnya adalah mediaNASjason. Dalam kasus saya, NAS adalah drive jaringan yang saya bagikan, jadi cukup spesifik untuk situasi saya. Yours cenderung berbeda. Sesuaikan tujuan dengan situasi Anda sendiri. Jika drive cadangan Anda adalah mediastorage dan Anda memiliki folder penyimpanan yang bernama frank, gunakan mediastoragefrank, dll. Dalam kasus saya: adalah tujuan saya. Sekarang, tentang sumbernya. Mereka cukup sederhana, sama seperti di atas kecuali itu tidak termasuk userserver. Jika Anda ingin seluruh direktori home Anda disinkronkan, Anda bisa melakukannya dengan: Jika Anda ingin seluruh direktori home Anda disinkronkan namun dengan pengecualian. gvfs dan flag --delete, gunakan: Mendapatkan jist dari sekarang Perhatikan, Anda dapat memiliki beberapa sumber juga, yang membuatnya berguna jika Anda hanya ingin mencadangkan beberapa folder tertentu ke server file Anda. Dalam kasus saya, saya memiliki ruang file server terbatas, jadi saya hanya ingin membuat cadangan data terpenting ke server file saya, yang bagi saya adalah Documents and Pictures. Contoh: Anda kemudian dapat mengatur tugas Cron agar berjalan pada waktu tertentu. Saya tidak pernah menjalankan rsync sebagai root, jadi ketika saya mengaturnya di Cron, saya mengaturnya untuk diluncurkan sebagai jason dan hanya menandai perintah rsync di atas. Sudah sejak saya pindah dari rute Cron. Saya mematikan komputer saya di malam hari, tapi server file saya tetap terjaga sepanjang waktu, saya menambahkan sebuah entri di Aplikasi Startup untuk melakukan backup untuk saya, yang berguna karena berjalan pada startup sistem. Saya menamainya NAS Backup dan meletakkan perintah di atas di kolom perintah. Semuanya bekerja seperti pesona dengan masukan nol yang dibutuhkan dari saya. Tip tipikal, jika Anda ingin memeriksa GUI rsync yang layak, jalankan grsync. Mudah digunakan dan akan membantu Anda menyusun perintah rsync jika Anda belum sepenuhnya yakin dulu. Perhatikan saja, tidak ada --exclude flag di GUI, jadi anda harus menambahkannya secara manual di bawah Additional Options, tapi cukup cantik - mudah dilakukan. Grsync juga tidak menggunakan - a, tapi malah memecah-a ke - t - o - p - g dll. Baca halaman manual rsync di bawah bagian-a untuk melihat mengapa hal ini membuat perbedaan littleno. Setelah Anda memformatnya sesuai keinginan Anda, Anda juga bisa melakukan uji coba, yang merupakan salah satu fitur grsync untuk memastikannya bekerja dengan benar sebelum memberi lampu hijau. Dengan asumsi semua sudah baik dan Anda sudah selesai, Anda bisa menjadwalkan pekerjaan grsync ini, Anda bisa menebaknya, baik Startup Applications atau Cron. Perlu diingat, sintaks untuk itu adalah grsync - e jobname. Jadi jika Anda menamai cadangan pekerjaan, Anda bisa menjalankan backup grsync - e. Ini sama dengan Cron atau Startup Applications. Saya mengujinya dengan menjalankannya di Startup Applications. Itu muncul dengan jendela GUI ketika saya log in menunjukkan status transfer data. Jika saya pergi rute dengan Aplikasi Startup dan hanya melempar perintah rsync penuh, ia melakukannya sepenuhnya di latar belakang. Bergantung pada seberapa besar status visual yang Anda inginkan dapat menentukan rute mana yang Anda pilih. Bagaimanapun, pujian yang serius kepada tim SSH, Rsync, dan Grsync, karena mereka telah menyeduh beberapa teknologi yang sangat mengesankan di sini. Hal di atas dimaksudkan untuk menjadi super informatif. Saya harap beberapa pengguna bisa menyiapkan sistem backup yang sesuai untuk mereka. Perlu diingat, Anda tidak pernah tahu kapan Mr. HardDrive akan menabrak Anda, jadi rencanakanlah di depan. Berikut adalah ringkasan kasar tentang apa yang Anda lakukan untuk pengguna yang tidak ingin membaca melalui teks. Catatan: Ubah pengaturan di bawah agar sesuai dengan pengaturan Anda, kecuali nama Anda kebetulan adalah Jason dan server file Anda adalah 192.168.1.150. Aplikasi Startup Klien - Pilih New - Namai backup atau apapun yang Anda inginkan, dan tambahkan baris rsync yang diinginkan di kotak perintah, seperti: Steve Friedls Tips Teknologi Unixwiz Banyak pengguna telah menerapkan Secure Shell (ssh) untuk menyediakan akses terlindungi ke Linux yang jauh Sistem, tapi jangan sadari bahwa dengan mengizinkan otentikasi password, mereka tetap terbuka terhadap serangan brute force dari manapun di internet. Ada cacing yang merajalela di internet yang melakukan pekerjaan yang efektif dengan menemukan kombinasi kata kunci yang lemah, dan ini tidak dihentikan oleh penggunaan Secure Shell. Kiat Tek ini merinci bagaimana menggunakan klien SSH PuTTY gratis untuk terhubung ke sistem Linux yang menjalankan server OpenSSH, semua saat menggunakan enkripsi kunci publik dan dukungan agen SSH. Sebagian besar informasi ini berlaku untuk instalasi OpenSSH manapun pada sistem UNIX manapun - Solaris, BSD, OpenServer - namun kami menargetkan hal ini ke platform Linux saat dibutuhkan. Instalasi dan konfigurasi sederhana Menyediakan akses tanpa password tanpa password, membutuhkan banyak langkah, jadi lakukan pendekatan ini dengan langkah pertama dengan memberikan akses reguler ke sistem. Hal ini memungkinkan untuk pengujian instalasi awal dan kemampuan untuk login sebelum mengaktifkan fitur yang lebih maju. Download dan instal program Tidak seperti kebanyakan program Windows, suite Putty tidak memerlukan installer: individu. File EXE langsung masuk ke direktori tempat mereka dijalankan secara langsung. Kami mengagumi ekonomi dan gaya yang diperlihatkan oleh para penulis PuTTY. File dapat dijatuhkan ke direktori manapun yang berada di jalur perintah pengguna, dan biasanya kita menggunakan C: BIN (lihat item berikutnya untuk cara mengkonfigurasi ini). Lima file harus didownload dari situs Putty. PuTTY. exe mdash Secure Shell klien PuTTYgen. exe mdash SSH publicprivate generator kunci Pagent. exe mdash agen kunci SSH PSCP. exe mdash Secure Copy dari baris perintah PSFTP. exe mdash Secure Copy dengan antarmuka seperti FTP Memastikan direktori instalasi ada di perintah Path Meskipun memungkinkan untuk menjalankan Putty dengan jalan atau jalan pintas penuh, dalam praktiknya sangat membantu saat sepenuhnya tersedia di CMD prompt untuk mengakses atau menyalin file dari manapun di filesystem. Klik kanan pada My Computer pada desktop dan pilih Properties. Klik tab Advanced di bagian atas, lalu klik tombol Environment Variables. Ini menampilkan kotak dialog yang ditampilkan di sebelah kanan. Selalu ada variabel PATH di bagian System Variables, dan terkadang di bagian User Variables juga. Hanya administrator yang memiliki akses ke Variabel Sistem, jadi Edit atau Tambah PATH sesuai kebutuhan. Kami biasanya meletakkan direktori baru di awal jalan, dan dipisahkan dari daftar lainnya dengan titik koma. Klik OK untuk menyimpan semua perubahan. Buat shortcut pada desktop Putty sering digunakan oleh pekerja IT, jadi sangat membantu untuk memiliki shortcut di desktop untuk memudahkan akses. Untuk menambahkan ini, klik kanan pada desktop dan klik New Shortcut. Entah Browse, atau ketik nama, jalur Putty bisa dieksekusi. Dalam contoh kita, yang telah C: binputty. exe. Klik OK dan berikan shortcut nama yang mudah digunakan. Luncurkan PuTTY dan konfigurasikan untuk sistem target Luncurkan PuTTY melalui shortcut, dan akan muncul kotak dialog configuration: ada banyak pilihan disini. Nah isi beberapa untuk menyediakan akses kata sandi ke sistem, kemudian konfigurasikan untuk akses kunci publik nanti. Kategori: Hostname: dbserver Protokol: () Koneksi SSH. Nama pengguna info masuk otomatis data: steve Connection. SSH Preferred SSH Protocol Versi: () 2 Hanya Setelah pengaturan sederhana ini telah dimasukkan, mereka dapat disimpan agar memudahkan akses lain kali. Klik Session di sebelah kiri, lalu masukkan nama dalam Saved Sessions - nama ini biasanya berhubungan dengan mesin yang terhubung dengan Anda. Klik Save untuk menyimpan pengaturan ini di Registry: weve memilih nama database server. Login Dengan pengaturan yang tersimpan dari langkah sebelumnya, nongol ingin menggunakannya untuk terhubung ke sistem target. Luncurkan PuTTY (jika belum terbuka), dan di bagian Sesi, klik nama sesi tersimpan dan klik Load. Klik Open untuk memulai koneksi. Saat diminta, masukkan kata sandi untuk akun Anda pada sistem remote, dan jika benar, Anda akan menerima sebuah shell. Sekarang Anda mungkin mulai mengerjakan sistem ini. Namun - setiap saat PuTTY terhubung dengan server, itu menukar identifikasi dalam bentuk kunci host. Jika kunci host tidak diketahui, atau tidak sesuai dengan apa yang telah dilihat sebelumnya, ini akan memperingatkan pengguna. Untuk host yang tidak dikenal, ini sebagian besar merupakan operasi pro forma, namun untuk sistem yang sebelumnya dikenal, mungkin disarankan bahwa host tidak sama seperti aslinya. Kunci host yang telah berubah tanpa peringatan dapat terjadi saat sistem operasi target diinstal ulang tanpa mengembalikan kunci host dari cadangan, atau bisa juga sesuatu yang lebih jahat seperti host nakal yang menyamar sebagai yang asli. Kita harus selalu bertanya ke dalam kunci host yang tidak terduga. Membuat dan menggunakan banyak sesi Bila pengguna hanya perlu terhubung dengan satu sistem, kemungkinannya untuk memprogram parameter ini ke dalam Sesi Default, namun jauh lebih umum untuk mengakses banyak sistem. Dengan sedikit penyiapan, kita dapat dengan mudah membuat dan terhubung ke sistem ini dengan sekali klik. Buat dan simpan sesi Seperti yang telah kami lakukan di bagian sebelumnya, buat dan simpan sebanyak sesi bernama sesuai kebutuhan, dan buat catatan nama sesi. Nama-nama ini dapat direferensikan pada baris perintah dengan parameter - load, dan bisa dimasukkan ke dalam shortcut. Klik kanan pada shortcut dan pilih Properties, lalu masukkan parameter-load beserta nama session (dalam tanda petik, jika perlu). Klik OK untuk menyimpan properti shortcut. Ini juga ide bagus untuk mengganti nama shortcut untuk mencerminkan nama server yang terhubung ke: klik kanan pada shortcut dan pilih Rename. Setelah pintasan sesi dikonfigurasi penuh, klik dua kali ikon akan meluncurkan sambungan. Buat banyak jalan pintas yang sudah diprogram sesuai kebutuhan. Membuat dan menginstal keypair publicprivate Kekuatan nyata Secure Shell ikut bermain saat kunci publicprivate digunakan. Tidak seperti otentikasi kata sandi, akses kunci publik dilakukan dengan melakukan pembuatan satu angka pasangan biner yang sangat lama yang terkait secara matematis. Langkah konfigurasi awal cukup banyak, tapi perlu dilakukan hanya sekali: sekali dibuat, kuncinya bisa dengan mudah dipasang pada sebanyak mungkin sistem remote seperti yang diinginkan. Jalankan PuTTYgen Sepasang kunci publicprivate mdash file kecil yang berisi bilangan biner mdash sangat besar diperlukan, dan PuTTYgen melakukan ini. Jalankannya hanya satu kali untuk membuat sepasang kunci pribadi, yang kemudian dipasang dimanapun dibutuhkan. Klik Mulai. Lalu Jalankan. Lalu masukkan puttygen pada kotak command-line. Ini menampilkan kotak dialog utama, ditunjukkan di sebelah kanan. Pilih parameter kunci seperti yang ditunjukkan, lalu klik Menghasilkan. Karena ukuran kunci DSA adalah tetap pada 1024 bit, dan kunci RSA dapat dibuat jauh lebih besar, kami merekomendasikan kunci RSA 2048 bit. Perhatikan bahwa defaultnya adalah 1024 bit, Anda harus mengganti secara manual untuk memilih 2048. Catatan: Jangan membuat kunci versi SSH 1 apapun: mereka tidak aman. Anda akan diminta untuk membuat beberapa keacakan dengan menggerakkan mouse ke sekeliling: ini memberi beberapa entropi tambahan sistem yang membantu menciptakan kunci yang lebih baik. Ini hanya membutuhkan beberapa detik untuk menghasilkan keypair sepenuhnya. Lindungi dan simpan kunci Sekarang keypair telah dihasilkan, tapi hanya ada dalam memori PuTTYgens: itu harus disimpan ke disk agar bisa digunakan. Meskipun kunci publik tidak berisi informasi sensitif dan akan diinstal pada sistem jarak jauh, kunci privat harus dilindungi dengan penuh semangat: siapa tahu kunci pribadi menjalankan semua sistem jarak jauh sepenuhnya. Kunci privat biasanya dilindungi dengan frasa sandi, dan frasa ini dimasukkan dua kali di bidang yang ditunjukkan. Komentar bersifat opsional namun biasanya adalah alamat email dari pemilik kunci. Bisa juga hanya menjadi nama pemilik. Jangan lupa frasa sandi itu keypair tidak ada gunanya tanpa itu. Kunci yang dihasilkan sekarang harus disimpan, dan ini dilakukan dalam tiga bagian: Save Public Key dan Save Private Key keduanya meminta nama file, dan kunci privat (dengan ekstensi. ppk) harus disimpan di tempat yang aman. Kunci publik ada dalam format standar dan dapat digunakan secara langsung atau tidak langsung oleh perangkat lunak lain, dan tampilannya seperti ini: Kunci privat ada dalam format khusus PuTTY yang tidak dapat digunakan oleh perangkat lunak lain. Tidak akan pernah dilihat langsung oleh operator. Instal kunci publik pada sistem Linux Dengan puttygen masih terbuka, sorot seluruh Kunci Publik untuk dimasukkan ke area file authorizedkey OpenSSH dan ketik kontrol-C untuk menyalin ke clipboard sistem lokal. Ini pada dasarnya adalah data yang sama seperti yang ditemukan pada file kunci publik yang tersimpan, namun dalam bentuk yang dapat langsung digunakan pada sistem Linux. Login ke komputer Linux dengan menggunakan kata sandi akun, buat direktori. ssh jika perlu, lalu edit file. sshauthorizedkeys. Ini akan menjadi file teks, dan clipboard harus disisipkan ke dalamnya. Kunci publik hanya akan menjadi satu garis panjang, dan sangat mudah untuk menempelkan data dengan cara yang memotong beberapa karakter pertama. Ini membuat kunci tidak bisa dioperasi, jadi pastikan kuncinya dimulai ssh-rsa atau ssh-dsa. Simpan file Pastikan kedua direktori. ssh dan file di dalamnya dapat dibaca hanya oleh pengguna saat ini (ini adalah tindakan pengamanan), dan ini dapat dicapai dengan menggunakan perintah chmod dengan parameter yang berlaku untuk keseluruhan direktori: Log out dari sistem. Catatan - file authorizedkeys harus dimiliki oleh pengguna dan tidak dapat dibaca oleh orang lain - server OpenSSH akan menolak masuk jika ini tidak terjadi. Seseorang dapat memeriksa ini dengan perintah ls: File harus mode - rw -------. Lampirkan kunci privat ke sesi SSH Sekarang setelah keypair publicprivate telah dibuat, ini dapat dikaitkan dengan sesi SSH. Pertama, lakukan ini dengan baik pada Putty dengan meluncurkan program dan memuat sesi minat. Arahkan ke Sambungan. SSH Auth di panel Kategori di sebelah kiri, lalu isi file kunci pribadi untuk bidang otentikasi dengan melihat file. ppk yang tersimpan sebelumnya. Catatan - Dengan klien Secure Shell lainnya, kami melihat kemampuan untuk melampirkan kunci pribadi ke semua sesi (sebagai bagian dari konfigurasi global), namun dengan Putty tampaknya memerlukan konfigurasi untuk setiap sesi. Tidak yakin mengapa. Kembali ke level kategori sesi dan simpan sesi saat ini. Pada titik ini, Putty (on Windows) dan OpenSSH (di Linux) keduanya dikonfigurasi untuk akses kunci publik yang aman. Sambungkan melalui kunci publik Setelah langkah-langkah konfigurasi selesai, siap untuk benar-benar login menggunakan mekanisme kunci publik, sama-sama menghindari langkah kata sandi. Sambungkan dengan aman Luncurkan PuTTY dengan opsi untuk memuat sesi tersimpan dengan kunci pribadi: Daripada meminta kata sandi akun (yang akan berbeda pada setiap sistem jarak jauh), maka dia meminta frasa sandi yang melindungi kunci privat setempat. Bila kunci pribadi sesuai dengan kunci publik pada server OpenSSH, akses yang diberikan dan shell yang diberikan kepada pengguna. Yang penting untuk dicatat bahwa meskipun pengguna harus mengetikkan kata rahasia saat log in, frasa sandi dikaitkan dengan kunci privat lokal. Bukan akun jauh. Bahkan jika kunci publik pengguna diinstal pada 1.000 server jarak jauh yang berbeda, kata kunci kunci privat yang sama dituntut untuk semuanya. Hal ini sangat menyederhanakan tugas mengingat kredensial akses dan mendorong pemilihan yang kuat dan aman. Menonaktifkan otentikasi password pada OpenSSH Setelah pengguna umum dan pribadi keypair diverifikasi sebagai benar, kemungkinan untuk menonaktifkan otentikasi kata sandi di server Linux sepenuhnya. Ini sepenuhnya mencegah semua kemungkinan upaya menebak kata sandi dan secara dramatis mengamankan sebuah mesin. Namun, untuk mesin yang tidak secara fisik lokal, bijak untuk menunda pengabsahan otentikasi password sampai benar-benar jelas bahwa akses kunci bekerja dengan benar, terutama jika banyak pengguna terlibat. Setelah otentikasi password telah dinonaktifkan, bahkan password root tidak mengizinkannya masuk ke sistem. Akses kunci baru ke publik didorong untuk diuji dengan sangat hati-hati. Konfigurasi Daemon SSH ditemukan di file sshdconfig, sering disimpan di direktori etcssh. Ini adalah file teks yang relatif mudah dibaca dengan baik mencari dua entri untuk dimodifikasi. Pertama adalah mengatur PasswordAuthentication ke nilai no. Ini mungkin secara eksplisit diatur ke ya. or it may be commented out to rely on the default, but we wish to explicitly disable this: Second, we wish to disable SSH protocol version 1: this is old, has several substantial security weaknesses, and should not be allowed from the outside world. Edit the configuration file and ensure that the two keyword entries are set properly comment out the old entries if necessary. Once the configuration file has been saved, the Secure Shell daemon must be restarted on most platforms this can be done with the service mechanism: This kills the listening daemon and restarts it, but does not terminate any existing individual user sessions. Those who feel this might be a risky step are invited to simply reboot the machine. At this point, OpenSSH will no longer accept passwords of any kind, with access granted only for users with pre-established public keys. Enabling SSH Agent Support Up to this point, weve provided a large manner of security of system access, but its still not terribly convenient: we still must type a (hopefully) complex pass phrase each time. This can get tedious when large numbers of systems are involved. Fortunately, the SSH suite provides a wonderful mechanism for unlocking the private key once, and allowing individual ssh connections to piggyback on it without querying for the passphrase every time. Launch the agent Navigate to and launch the pageant. exe program from the same location as the other PuTTY-related files, and it will put itself into the system tray (in the lower right near the clock). Double-click the icon in the tray, and it launches a dialog box with an empty list of keys. Click Add Key and navigate to the. ppk file which contains your private key. When prompted for the passphrase, enter it and click OK. Click Close to dismiss the agent. Now, launch one of the already-configured SSH sessions to a pubkey-secured remote host: it will query the agent for the private key, exchange it with the remote, and grant access without further user intervention. Note - the thoughtful reader may wonder just how the agent stores the data, and whether untrusted programs are able to obtain this secret key surreptitiously. Were not sure how it works, but weve not ever heard of real security concerns on this front. Well update this document if we learn something. Preload the private key The first thing that many PuTTY users do when logging into the system for the day is to launch the agent and add the private key. This is just a few steps, but we can optimize it just a bit more. If we launch the agent with the private key file as a parameter, it loads the key automatically. Navigate to pageant. exe and right-click to copy this icon. Paste this as a shortcut on the desktop, then right-click and select Properties. Enter the full path of the. ppk private key file as the parameter, then save the changes. Double-clicking this icon will load the keyfile, demanding the passphrase. Once entered, thats the last time its needed as long as the agent sticks around. There is very little not to like about SSH agent support. Agent Forwarding But weve not exhausted the benefits of SSH agent support. Its a clear win to avoid typing the passphrase every time a new connection is launched, but SSH also provides Agent Forwarding which can pass the credential down the connection to the remote server. This credential can then be passed to yet another server where the users public key has been installed, obviating passwords or the secret passphrase for the entire duration of a network navigation. User launches a connection to Server A: PuTTY on the local machine gets the private key from the agent and provides it to the remote server. Remote server processes the public and private key data and grants access. The user is given a shell on the local system. User attempts to connect to SystemB with ssh - A systemb ( - A enables agent forwarding), and it connects to the SSH server there. System B asks system A for the users private key data, and the SSH server on system A in turn forwards this back to the original workstation where the agent is queried. The local agent passes the data back up the connection, where its forwarded from SystemA to SystemB. SystemB receives this credential, and access is granted by comparing to the public key stored on that machine for that user. This happens automatically and quickly: it takes no more than a second or two for the entire exchange to occur, and this forwarding can go over quite a long chain of SSH connections. This provides for transparent, secure access to a wide range of remote systems. Note - All of this requires that the user have an account on each machine in question, and that the users public key is installed properly on each one. SSH forwarding doesnt provide any access which would not be granted absent forwarding it just adds a more convenient mechanism to whats already provided. Enable Forwarding in PuTTY Enabling agent forwarding is done in the PuTTY configuration dialogs much like all the rest, and just one additional box need to be checked. This option requires, of course, the use of pageant on the local system - without an agent, theres nothing to forward. Should a key-protected connection be attempted with no agent present, PuTTY will simply prompt for the passphrase as it has all along (and will do so on each connection ). Enable Forwarding on the Server In the example above, we saw that the user typed ssh - A host . but its common to make Use agent forwarding the default setting to remove the need to type the - A. The OpenSSH server configuration is found in sshdconfig . while the client configuration is in sshconfig (typically in the etcssh directory). The file can be edited and the ForwardAgent setting set to yes: This setting doesnt affect the server, so it requires no reboot or special operation for it to take effect: the next outbound connection will enable forwarding automatically. This change need be made only once (and its the default on some systems). Copying files securely With the configuration of PuTTY, public key access, and agent support (with forwarding), were prepared to step beyond terminal shell access and move files around. Secure Shell provides multiple methods for copying files from one machine to another, all working together with the same keys and agents. PSCP allows for command-line copying of files to and from a remote SSH server, and PSFTP provides an FTP-like interface for convenient file transfer. Well discuss both. PSFTP - an FTP-like client The PSFTP program can be launched from the command line or from a desktop shortcut, and in both cases accepts either a hostname or a saved session name. When launched, it connects to the target server (fully taking advantage of public keys and the local agent, if any), and presents a psftpgt prompt: Regular users of command-line FTP clients will find this familiar, though its certainly not up to the ease of use as popular GUI clients. The help command may provide some guidance. PSCP - Secure Copy Users at the command line may wish to copy files directly, and this is done with pscp . the Secure Copy command. Just like copying regular files on the local filesystem, pscp takes a machine name and directory as a source or destination. pscp can transfer one file at a time, or a whole set in a single instance: Curiously, the saved session name need not be provided just the hostname and the current username (which is usually taken automatically from the environment. It appears that psftp and pscp both consult the saved-session list, find an appropriate match, and then use the access information associated. This makes for a smooth file-transfer experience. Security Concerns and the Finer Points This Tech Tip has intended to provide a fast path to setting up a Secure Shell environment from workstation to server, but it has skipped over many of the finer points. The whole point of using Secure Shell is Security, and wed be remiss if we didnt touch on some of these points here. Well make the broader point that one must take care when working on an untrusted system: when using advanced features such as agent forwarding or private keys, one is at the mercy of a hostile operator. Kernel-based keyloggers and Trojaned binssh bi naries are just a few of many obvious risks when operating in that kind of environment. Here well touch on a few of the non-obvious points and note that in a trusted and controlled environment, these issues simply dont arise. Protect your private key Though the public key is of only minor concern, the private key must be protected vigorously. Anyone who can get to the decrypted private key (either by learning the passphrase, or brute-forcing it) has full run of all networks where the public key is installed. We strongly recommend limiting dramatically the number of places where the private key is kept. We presume that applications exist which can take a private-key file and attempt to brute-force the key, though weve not yet run across one. Agent use requires trusted machines Whenever an SSH key agent is present, whether it be on the local machine which initiates the outgoing connection, or on intermediate machines which are forwarding them, its technically possible for interlopers on those machines to get access to the secure channel. In OpenSSH, an ssh client communicates with the agent via a UNIX domain socket under the tmp directory( a representative file is tmpssh-DeB10132agent.10132 ), and its restricted to the local user. But superusers also have access to the socket, and its relatively straightforward to hijack the agent to connect to the same target machine. Related ResourcesOpenSSH is the premier connectivity tool for remote login with the SSH protocol. It encrypts all traffic to eliminate eavesdropping, connection hijacking, and other attacks. In addition, OpenSSH provides a large suite of secure tunneling capabilities, several authentication methods, and sophisticated configuration options. OpenSSH is developed by a few developers of the OpenBSD Project and made available under a BSD-style license. OpenSSH is incorporated into many commercial products, but very few of those companies assist OpenSSH with funding. Contributions towards OpenSSH can be sent to the OpenBSD Foundation. This site Copyright copy 1999-2017 OpenBSD. sshdconfig(5) - Linux man page sshdconfig - OpenSSH SSH daemon configuration file Description sshd (8) reads configuration data from etcsshsshdconfig (or the file specified with - f on the command line). The file contains keyword-argument pairs, one per line. Lines starting with and empty lines are interpreted as comments. Arguments may optionally be enclosed in double quotes () in order to represent arguments containing spaces. The possible keywords and their meanings are as follows (note that keywords are case-insensitive and arguments are case-sensitive): Specifies what environment variables sent by the client will be copied into the sessions environ (7). See SendEnv in sshconfig (5) for how to configure the client. Note that environment passing is only supported for protocol 2. Variables are specified by name, which may contain the wildcard characters and . Multiple environment variables may be separated by whitespace or spread across multiple AcceptEnv directives. Be warned that some environment variables could be used to bypass restricted user environments. For this reason, care should be taken in the use of this directive. The default is not to accept any environment variables. AddressFamily Specifies which address family should be used by sshd (8). Valid arguments are any, inet (use IPv4 only), or inet6 (use IPv6 only). The default is any. AllowAgentForwarding Specifies whether ssh-agent (1) forwarding is permitted. The default is yes. Note that disabling agent forwarding does not improve security unless users are also denied shell access, as they can always install their own forwarders. AllowGroups This keyword can be followed by a list of group name patterns, separated by spaces. If specified, login is allowed only for users whose primary group or supplementary group list matches one of the patterns. Only group names are valid a numerical group ID is not recognized. By default, login is allowed for all groups. The allowdeny directives are processed in the following order: DenyUsers . AllowUsers . DenyGroups . and finally AllowGroups . See PATTERNS in sshconfig (5) for more information on patterns. AllowTcpForwarding Specifies whether TCP forwarding is permitted. The default is yes. Note that disabling TCP forwarding does not improve security unless users are also denied shell access, as they can always install their own forwarders. AllowUsers This keyword can be followed by a list of user name patterns, separated by spaces. If specified, login is allowed only for user names that match one of the patterns. Only user names are valid a numerical user ID is not recognized. By default, login is allowed for all users. If the pattern takes the form USERHOST then USER and HOST are separately checked, restricting logins to particular users from particular hosts. The allowdeny directives are processed in the following order: DenyUsers . AllowUsers . DenyGroups . and finally AllowGroups . See PATTERNS in sshconfig (5) for more information on patterns. AuthorizedKeysFile Specifies the file that contains the public keys that can be used for user authentication. AuthorizedKeysFile may contain tokens of the form T which are substituted during connection setup. The following tokens are defined: is replaced by a literal , h is replaced by the home directory of the user being authenticated, and u is replaced by the username of that user. After expansion, AuthorizedKeysFile is taken to be an absolute path or one relative to the users home directory. The default is. sshauthorizedkeys. Banner The contents of the specified file are sent to the remote user before authentication is allowed. If the argument is none then no banner is displayed. This option is only available for protocol version 2. By default, no banner is displayed. ChallengeResponseAuthentication Specifies whether challenge-response authentication is allowed (e. g. via PAM or though authentication styles supported in login. conf (5)) The default is yes. ChrootDirectory Specifies a path to chroot (2) to after authentication. This path, and all its components, must be root-owned directories that are not writable by any other user or group. After the chroot, sshd (8) changes the working directory to the users home directory. The path may contain the following tokens that are expanded at runtime once the connecting user has been authenticated: is replaced by a literal , h is replaced by the home directory of the user being authenticated, and u is replaced by the username of that user. The ChrootDirectory must contain the necessary files and directories to support the users session. For an interactive session this requires at least a shell, typically sh (1), and basic dev nodes such as null (4), zero (4), stdin (4), stdout (4), stderr (4), arandom (4) and tty (4) devices. For file transfer sessions using sftp, no additional configuration of the environment is necessary if the in-process sftp server is used, though sessions which use logging do require devlog inside the chroot directory (see sftp-server (8) for details). The default is not to chroot (2). Ciphers Specifies the ciphers allowed for protocol version 2. Multiple ciphers must be comma-separated. The supported ciphers are 3des-cbc, aes128-cbc, aes192-cbc, aes256-cbc, aes128-ctr, aes192-ctr, aes256-ctr, arcfour128, arcfour256, arcfour, blowfish-cbc, and cast128-cbc. The default is: aes128-ctr, aes192-ctr, aes256-ctr, arcfour256,arcfour128, aes128-cbc,3des-cbc, blowfish-cbc, cast128-cbc, aes192-cbc, aes256-cbc, arcfour Sets the number of client alive messages (see below) which may be sent without sshd (8) receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. It is important to note that the use of client alive messages is very different from TCPKeepAlive (below). The client alive messages are sent through the encrypted channel and therefore will not be spoofable. The TCP keepalive option enabled by TCPKeepAlive is spoofable. The client alive mechanism is valuable when the client or server depend on knowing when a connection has become inactive. The default value is 3. If ClientAliveInterval (see below) is set to 15, and ClientAliveCountMax is left at the default, unresponsive SSH clients will be disconnected after approximately 45 seconds. This option applies to protocol version 2 only. ClientAliveInterval Sets a timeout interval in seconds after which if no data has been received from the client, sshd (8) will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. This option applies to protocol version 2 only. Compression Specifies whether compression is allowed, or delayed until the user has authenticated successfully. The argument must be yes, delayed, or no. The default is delayed. DenyGroups This keyword can be followed by a list of group name patterns, separated by spaces. Login is disallowed for users whose primary group or supplementary group list matches one of the patterns. Only group names are valid a numerical group ID is not recognized. By default, login is allowed for all groups. The allowdeny directives are processed in the following order: DenyUsers . AllowUsers . DenyGroups . and finally AllowGroups . See PATTERNS in sshconfig (5) for more information on patterns. DenyUsers This keyword can be followed by a list of user name patterns, separated by spaces. Login is disallowed for user names that match one of the patterns. Only user names are valid a numerical user ID is not recognized. By default, login is allowed for all users. If the pattern takes the form USERHOST then USER and HOST are separately checked, restricting logins to particular users from particular hosts. The allowdeny directives are processed in the following order: DenyUsers . AllowUsers . DenyGroups . and finally AllowGroups . See PATTERNS in sshconfig (5) for more information on patterns. ForceCommand Forces the execution of the command specified by ForceCommand . ignoring any command supplied by the client and. sshrc if present. The command is invoked by using the users login shell with the - c option. This applies to shell, command, or subsystem execution. It is most useful inside a Match block. The command originally supplied by the client is available in the SSHORIGINALCOMMAND environment variable. Specifying a command of internal-sftp will force the use of an in-process sftp server that requires no support files when used with ChrootDirectory . GatewayPorts Specifies whether remote hosts are allowed to connect to ports forwarded for the client. By default, sshd (8) binds remote port forwardings to the loopback address. This prevents other remote hosts from connecting to forwarded ports. GatewayPorts can be used to specify that sshd should allow remote port forwardings to bind to non-loopback addresses, thus allowing other hosts to connect. The argument may be no to force remote port forwardings to be available to the local host only, yes to force remote port forwardings to bind to the wildcard address, or clientspecified to allow the client to select the address to which the forwarding is bound. The default is no. GSSAPIAuthentication Specifies whether user authentication based on GSSAPI is allowed. The default is no. Note that this option applies to protocol version 2 only. GSSAPIKeyExchange Specifies whether key exchange based on GSSAPI is allowed. GSSAPI key exchange doesnt rely on ssh keys to verify host identity. The default is no. Note that this option applies to protocol version 2 only. GSSAPICleanupCredentials Specifies whether to automatically destroy the users credentials cache on logout. The default is yes. Note that this option applies to protocol version 2 only. GSSAPIStrictAcceptorCheck Determines whether to be strict about the identity of the GSSAPI acceptor a client authenticates against. If yes then the client must authenticate against the host service on the current hostname. If no then the client may authenticate against any service key stored in the machines default store. This facility is provided to assist with operation on multi homed machines. The default is yes. Note that this option applies only to protocol version 2 GSSAPI connections, and setting it to no may only work with recent Kerberos GSSAPI libraries. GSSAPIStoreCredentialsOnRekey Controls whether the users GSSAPI credentials should be updated following a successful connection rekeying. This option can be used to accepted renewed or updated credentials from a compatible client. The default is no. HostbasedAuthentication Specifies whether rhosts or etchosts. equiv authentication together with successful public key client host authentication is allowed (host-based authentication). This option is similar to RhostsRSAAuthentication and applies to protocol version 2 only. The default is no. HostbasedUsesNameFromPacketOnly Specifies whether or not the server will attempt to perform a reverse name lookup when matching the name in the. rhosts . and etchosts. equiv files during HostbasedAuthentication . A setting of yes means that sshd (8) uses the name supplied by the client rather than attempting to resolve the name from the TCP connection itself. The default is no. HostKey Specifies a file containing a private host key used by SSH. The default is etcsshsshhostkey for protocol version 1, and etcsshsshhostrsakey and etcsshsshhostdsakey for protocol version 2. Note that sshd (8) will refuse to use a file if it is groupworld-accessible. It is possible to have multiple host key files. rsa1 keys are used for version 1 and dsa or rsa are used for version 2 of the SSH protocol. IgnoreRhosts Specifies that. rhosts and. shosts files will not be used in RhostsRSAAuthentication or HostbasedAuthentication . etchosts. equiv and etcsshshosts. equiv are still used. The default is yes. IgnoreUserKnownHosts Specifies whether sshd (8) should ignore the users. sshknownhosts during RhostsRSAAuthentication or HostbasedAuthentication . The default is no. KerberosAuthentication Specifies whether the password provided by the user for PasswordAuthentication will be validated through the Kerberos KDC. To use this option, the server needs a Kerberos servtab which allows the verification of the KDCs identity. The default is no. KerberosGetAFSToken If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire an AFS token before accessing the users home directory. The default is no. KerberosOrLocalPasswd If password authentication through Kerberos fails then the password will be validated via any additional local mechanism such as etcpasswd . The default is yes. KerberosTicketCleanup Specifies whether to automatically destroy the users ticket cache file on logout. The default is yes. KerberosUseKuserok Specifies whether to look at. k5login file for users aliases. The default is yes. KeyRegenerationInterval In protocol version 1, the ephemeral server key is automatically regenerated after this many seconds (if it has been used). The purpose of regeneration is to prevent decrypting captured sessions by later breaking into the machine and stealing the keys. The key is never stored anywhere. If the value is 0, the key is never regenerated. The default is 3600 (seconds). ListenAddress Specifies the local addresses sshd (8) should listen on. The following forms may be used: If port is not specified, sshd will listen on the address and all prior Port options specified. The default is to listen on all local addresses. Multiple ListenAddress options are permitted. Additionally, any Port options must precede this option for non-port qualified addresses. LoginGraceTime The server disconnects after this time if the user has not successfully logged in. If the value is 0, there is no time limit. The default is 120 seconds. LogLevel Gives the verbosity level that is used when logging messages from sshd (8). The possible values are: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. The default is INFO. DEBUG and DEBUG1 are equivalent. DEBUG2 and DEBUG3 each specify higher levels of debugging output. Logging with a DEBUG level violates the privacy of users and is not recommended. MACs Specifies the available MAC (message authentication code) algorithms. The MAC algorithm is used in protocol version 2 for data integrity protection. Multiple algorithms must be comma-separated. The default is: hmac-md5,hmac-sha1,umac-64openssh , hmac-ripemd160,hmac-sha1-96,hmac-md5-96 Introduces a conditional block. If all of the criteria on the Match line are satisfied, the keywords on the following lines override those set in the global section of the config file, until either another Match line or the end of the file. The arguments to Match are one or more criteria-pattern pairs. The available criteria are User . Group . Host . and Address . The match patterns may consist of single entries or comma-separated lists and may use the wildcard and negation operators described in the PATTERNS section of sshconfig (5). The patterns in an Address criteria may additionally contain addresses to match in CIDR addressmasklen format, e. g. 192.0.2.024 or 3ffe:ffff::32. Note that the mask length provided must be consistent with the address - it is an error to specify a mask length that is too long for the address or one with bits set in this host portion of the address. For example, 192.0.2.033 and 192.0.2.08 respectively. Only a subset of keywords may be used on the lines following a Match keyword. Available keywords are AllowAgentForwarding . AllowTcpForwarding . Banner . ChrootDirectory . ForceCommand . GatewayPorts . GSSAPIAuthentication . HostbasedAuthentication . KbdInteractiveAuthentication . KerberosAuthentication . KerberosUseKuserok . MaxAuthTries . MaxSessions . PubkeyAuthentication . AuthorizedKeysCommand . AuthorizedKeysCommandRunAs . PasswordAuthentication . PermitEmptyPasswords . PermitOpen . PermitRootLogin . RequiredAuthentications1, RequiredAuthentications2, RhostsRSAAuthentication . RSAAuthentication . X11DisplayOffset . X11Forwarding and X11UseLocalHost . MaxAuthTries Specifies the maximum number of authentication attempts permitted per connection. Once the number of failures reaches half this value, additional failures are logged. The default is 6. MaxSessions Specifies the maximum number of open sessions permitted per network connection. The default is 10. MaxStartups Specifies the maximum number of concurrent unauthenticated connections to the SSH daemon. Additional connections will be dropped until authentication succeeds or the LoginGraceTime expires for a connection. The default is 10. Alternatively, random early drop can be enabled by specifying the three colon separated values start:rate:full (e. g. 10:30:60). sshd (8) will refuse connection attempts with a probability of rate100 (30) if there are currently start (10) unauthenticated connections. The probability increases linearly and all connection attempts are refused if the number of unauthenticated connections reaches full (60). PasswordAuthentication Specifies whether password authentication is allowed. The default is yes. PermitEmptyPasswords When password authentication is allowed, it specifies whether the server allows login to accounts with empty password strings. The default is no. PermitOpen Specifies the destinations to which TCP port forwarding is permitted. The forwarding specification must be one of the following forms: Multiple forwards may be specified by separating them with whitespace. An argument of any can be used to remove all restrictions and permit any forwarding requests. By default all port forwarding requests are permitted. PermitRootLogin Specifies whether root can log in using ssh (1). The argument must be yes, without-password, forced-commands-only, or no. The default is yes. If this option is set to without-password, password authentication is disabled for root. If this option is set to forced-commands-only, root login with public key authentication will be allowed, but only if the command option has been specified (which may be useful for taking remote backups even if root login is normally not allowed). All other authentication methods are disabled for root. If this option is set to no, root is not allowed to log in. PermitTunnel Specifies whether tun (4) device forwarding is allowed. The argument must be yes, point-to-point (layer 3), ethernet (layer 2), or no. Specifying yes permits both point-to-point and ethernet. The default is no. PermitUserEnvironment Specifies whether. sshenvironment and environment options in. sshauthorizedkeys are processed by sshd (8). The default is no. Enabling environment processing may enable users to bypass access restrictions in some configurations using mechanisms such as LDPRELOAD. PidFile Specifies the file that contains the process ID of the SSH daemon. The default is varrunsshd. pid . Port Specifies the port number that sshd (8) listens on. The default is 22. Multiple options of this type are permitted. See also ListenAddress . PrintLastLog Specifies whether sshd (8) should print the date and time of the last user login when a user logs in interactively. The default is yes. PrintMotd Specifies whether sshd (8) should print etcmotd when a user logs in interactively. (On some systems it is also printed by the shell, etcprofile . or equivalent.) The default is yes. Protocol Specifies the protocol versions sshd (8) supports. The possible values are 1 and 2. Multiple versions must be comma-separated. The default is 2,1. Note that the order of the protocol list does not indicate preference, because the client selects among multiple protocol versions offered by the server. Specifying 2,1 is identical to 1,2. PubkeyAuthentication Specifies whether public key authentication is allowed. The default is yes. Note that this option applies to protocol version 2 only. AuthorizedKeysCommand Specifies a program to be used for lookup of the users public keys. The program will be invoked with its first argument the name of the user being authorized, and should produce on standard output AuthorizedKeys lines (see AUTHORIZEDKEYS in sshd (8)). By default (or when set to the empty string) there is no AuthorizedKeysCommand run. If the AuthorizedKeysCommand does not successfully authorize the user, authorization falls through to the AuthorizedKeysFile. Note that this option has an effect only with PubkeyAuthentication turned on. AuthorizedKeysCommandRunAs Specifies the user under whose account the AuthorizedKeysCommand is run. Empty string (the default value) means the user being authorized is used. RequiredAuthentications12 Specifies required methods of authentications that has to succeed before authorizing the connection. (RequiredAuthentication1 for Protocol version 1, and RequiredAuthentication2 for v2) RequiredAuthentications1 method, method. RequiredAuthentications2 method, method. Example 1: Example 2: Available methods: Specifies whether rhosts or etchosts. equiv authentication together with successful RSA host authentication is allowed. The default is no. This option applies to protocol version 1 only. RSAAuthentication Specifies whether pure RSA authentication is allowed. The default is yes. This option applies to protocol version 1 only. ServerKeyBits Defines the number of bits in the ephemeral protocol version 1 server key. The minimum value is 512, and the default is 1024. ShowPatchLevel Specifies whether sshd will display the patch level of the binary in the identification string. The patch level is set at compile-time. The default is no. This option applies to protocol version 1 only. StrictModes Specifies whether sshd (8) should check file modes and ownership of the users files and home directory before accepting login. This is normally desirable because novices sometimes accidentally leave their directory or files world-writable. The default is yes. Subsystem Configures an external subsystem (e. g. file transfer daemon). Arguments should be a subsystem name and a command (with optional arguments) to execute upon subsystem request. The command sftp-server (8) implements the sftp file transfer subsystem. Alternately the name internal-sftp implements an in-process sftp server. This may simplify configurations using ChrootDirectory to force a different filesystem root on clients. By default no subsystems are defined. Note that this option applies to protocol version 2 only. SyslogFacility Gives the facility code that is used when logging messages from sshd (8). The possible values are: DAEMON, USER, AUTH, AUTHPRIV, LOCAL0, LOCAL1, LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. The default is AUTH. TCPKeepAlive Specifies whether the system should send TCP keepalive messages to the other side. If they are sent, death of the connection or crash of one of the machines will be properly noticed. However, this means that connections will die if the route is down temporarily, and some people find it annoying. On the other hand, if TCP keepalives are not sent, sessions may hang indefinitely on the server, leaving ghost users and consuming server resources. The default is yes (to send TCP keepalive messages), and the server will notice if the network goes down or the client host crashes. This avoids infinitely hanging sessions. To disable TCP keepalive messages, the value should be set to no. UseDNS Specifies whether sshd (8) should look up the remote host name and check that the resolved host name for the remote IP address maps back to the very same IP address. The default is yes. UseLogin Specifies whether login (1) is used for interactive login sessions. The default is no. Note that login (1) is never used for remote command execution. Note also, that if this is enabled, X11Forwarding will be disabled because login (1) does not know how to handle xauth (1) cookies. If UsePrivilegeSeparation is specified, it will be disabled after authentication. UsePAM Enables the Pluggable Authentication Module interface. If set to yes this will enable PAM authentication using ChallengeResponseAuthentication and PasswordAuthentication in addition to PAM account and session module processing for all authentication types. Because PAM challenge-response authentication usually serves an equivalent role to password authentication, you should disable either PasswordAuthentication or ChallengeResponseAuthentication. If UsePAM is enabled, you will not be able to run sshd (8) as a non-root user. The default is no. UsePrivilegeSeparation Specifies whether sshd (8) separates privileges by creating an unprivileged child process to deal with incoming network traffic. After successful authentication, another process will be created that has the privilege of the authenticated user. The goal of privilege separation is to prevent privilege escalation by containing any corruption within the unprivileged processes. The default is yes. X11DisplayOffset Specifies the first display number available for sshd (8)s X11 forwarding. This prevents sshd from interfering with real X11 servers. The default is 10. X11Forwarding Specifies whether X11 forwarding is permitted. The argument must be yes or no. The default is no. When X11 forwarding is enabled, there may be additional exposure to the server and to client displays if the sshd (8) proxy display is configured to listen on the wildcard address (see X11UseLocalhost below), though this is not the default. Additionally, the authentication spoofing and authentication data verification and substitution occur on the client side. The security risk of using X11 forwarding is that the clients X11 display server may be exposed to attack when the SSH client requests forwarding (see the warnings for ForwardX11 in sshconfig (5)). A system administrator may have a stance in which they want to protect clients that may expose themselves to attack by unwittingly requesting X11 forwarding, which can warrant a no setting. Note that disabling X11 forwarding does not prevent users from forwarding X11 traffic, as users can always install their own forwarders. X11 forwarding is automatically disabled if UseLogin is enabled. X11UseLocalhost Specifies whether sshd (8) should bind the X11 forwarding server to the loopback address or to the wildcard address. By default, sshd binds the forwarding server to the loopback address and sets the hostname part of the DISPLAY environment variable to localhost. This prevents remote hosts from connecting to the proxy display. However, some older X11 clients may not function with this configuration. X11UseLocalhost may be set to no to specify that the forwarding server should be bound to the wildcard address. The argument must be yes or no. The default is yes. XAuthLocation Specifies the full pathname of the xauth (1) program. The default is usrbinxauth . Time Formats sshd (8) command-line arguments and configuration file options that specify time may be expressed using a sequence of the form: time qualifier , where time is a positive integer value and qualifier is one of the following: seconds s S seconds m M minutes h H hours d D days w W weeks Each member of the sequence is added together to calculate the total time value. Time format examples: 600 600 seconds (10 minutes) 10m 10 minutes 1h30m 1 hour 30 minutes (90 minutes) Contains configuration data for sshd (8). This file should be writable by root only, but it is recommended (though not necessary) that it be world-readable. OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo de Raadt and Dug Song removed many bugs, re-added newer features and created OpenSSH. Markus Friedl contributed the support for SSH protocol versions 1.5 and 2.0. Niels Provos and Markus Friedl contributed support for privilege separation. BSD April 14, 2013 BSD Referenced By

No comments:

Post a Comment