1.更新
$sudo apt-get update
2.安裝 ssh 與 openssh-server
$sudo apt-get install ssh openssh-server -y
3.編輯 ssh 設定檔,取消root 的登入權限
$sudo pico /etc/ssh/sshd_config
將 PermitRootLogin prohibit-password 改成PermitRootLogin no
4.設定安全性,編輯可連線的主機群 ex 192.168.25.1
$sudo pico /etc/hosts.allow
sshd:192.168.25.1:allow
$sudo pico /etc/hosts.deny
sshd:all:deny
5.重啟ssh伺服器
$sudo /etc/init.d/ssh restart
6.現在要使用shell 來安裝與設定
檔名:sshInstall.sh
內容:
#!/bin/bash
apt-get update
apt-get install ssh openssh-server -y
sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin no/g' /etc/ssh/sshd_config
echo "sshd:192.168.25.1:allow" >> /etc/hosts.allow
echo "sshd:all:deny" >> /etc/hosts.deny
/etc/init.d/ssh restart
資料來源:
1.Ubuntu 安裝和啟用 SSH 登入
2.Ubuntu 用 SSH + 憑證登入遠端主機
3.[Shell Script] 用echo將文字以附加(apppend)方式寫入檔案
標籤
BAT
(38)
shell
(34)
Virtual Machine
(33)
Xubuntu
(29)
acfs
(25)
PHP
(24)
CentOS
(21)
Virtul Box
(20)
編輯器
(17)
資料庫
(15)
lubuntu
(13)
windows
(13)
CPP
(12)
ubuntu
(12)
chrome
(11)
laravel
(10)
Docker
(9)
Python
(9)
5A88
(7)
VMware
(6)
資料結構
(6)
Javascript
(5)
Node
(5)
Proxmox VE
(5)
公告系統
(5)
程式積木
(5)
Android Studio
(4)
ANN
(3)
OB2D2016x64
(3)
Xoops
(3)
clonezilla
(3)
samba
(3)
公文
(3)
其他
(3)
硬體
(3)
API
(2)
Android
(2)
AppInvent2
(2)
Html
(2)
Hyper-V
(2)
Nas
(2)
botnet
(2)
mbot
(2)
swift
(2)
wordpress
(2)
樣板
(2)
防火牆
(2)
AD的應用
(1)
Ansible
(1)
Arduino
(1)
CSS
(1)
GitLab
(1)
HA Proxy
(1)
LegoEV3
(1)
PowerShell
(1)
Scratch
(1)
VM
(1)
XenServer
(1)
kotlin
(1)
linuxmint
(1)
lxc
(1)
訂閱:
張貼留言 (Atom)
在 Windows 10 x64 1909版,使用BAT快速安裝公文系統與人事服務網(自然人憑證)版
相關內容移往 https://skjhcreator.blogspot.com/2021/02/windows-10-x64-1909bat.html
-
後篇: 只要用滑鼠點兩下,開啟五種不同瀏覽器瀏覽特定的網頁 讓Chrome瀏覽器自動開啟網頁 檔名:ChromeStart.bat 內容: @echo off start "C:\Program Files (x86)\Google\Chrome\A...
-
在國民中小學電腦教室實施教學,最大的兩個問題是 一、如何將教師的檔案給學生,或是學生如何取得教師的檔案? 二、學生要交作業,要如何交給老師? 現在利用HFS (Http File Server),來解決這些問題。 1.HFS下載與說明: 下載處 ,下載完後,解...
-
要利用Code::Blocks來完成APCS考試,又不想背太多程式碼。希望考試時,檢測環境能夠出現字體放大、程式碼自動提示與補完。所以就設定Code::Blocks。 1.字體放大 方法(1).按住Ctrl滾滑鼠滾輪,程式代碼的字體會隨你心意變大變小 方法(2)...
沒有留言:
張貼留言