2015年8月27日 星期四

Ubuntu 安裝 SSH 支援 - OpenSSH

Ubuntu 安裝 SSH 支援 - OpenSSH


簡述

在 VM 中安裝完 Ubuntu Server 後, 原本的 tty 是在英文模式下, 要檢視或是編輯含中文內容或檔名的文件會有問題。在 Ubuntu 安裝 SSH 支援, 讓系統可以從外部透過 ssh 連線工具連線, 不但解決的中文顯示和編輯的問題, 還有可調整大小的純文字視窗環境且不用再按鍵來切換 VM 和 Windows 環境!

安裝指令:

$ sudo apt-get update
$ sudo apt-get install openssh-server -y

安裝過程:

Reading package lists...
Building dependency tree...
Reading state information...
The following extra packages will be installed:
  libck-connector0 ncurses-term openssh-client openssh-sftp-server
  python-requests python-urllib3 ssh-import-id
Suggested packages:
  ssh-askpass libpam-ssh keychain monkeysphere rssh molly-guard
The following NEW packages will be installed:
  libck-connector0 ncurses-term openssh-server openssh-sftp-server
  python-requests python-urllib3 ssh-import-id
The following packages will be upgraded:
  openssh-client
1 upgraded, 7 newly installed, 0 to remove and 6 not upgraded.
Need to get 935 kB/1,280 kB of archives.
After this operation, 3,898 kB of additional disk space will be used.
Get:1 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main openssh-client i386 1:6.6p1-2ubuntu2.3 [576 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main openssh-sftp-server i386 1:6.6p1-2ubuntu2.3 [35.6 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu/ trusty-updates/main openssh-server i386 1:6.6p1-2ubuntu2.3 [324 kB]
Preconfiguring packages ...
Fetched 935 kB in 3s (251 kB/s)
Selecting previously unselected package libck-connector0:i386.
(Reading database ... 84931 files and directories currently installed.)
Preparing to unpack .../libck-connector0_0.4.5-3.1ubuntu2_i386.deb ...
Unpacking libck-connector0:i386 (0.4.5-3.1ubuntu2) ...
Preparing to unpack .../openssh-client_1%3a6.6p1-2ubuntu2.3_i386.deb ...
Unpacking openssh-client (1:6.6p1-2ubuntu2.3) over (1:6.6p1-2ubuntu2) ...
Selecting previously unselected package ncurses-term.
Preparing to unpack .../ncurses-term_5.9+20140118-1ubuntu1_all.deb ...
Unpacking ncurses-term (5.9+20140118-1ubuntu1) ...
Selecting previously unselected package openssh-sftp-server.
Preparing to unpack .../openssh-sftp-server_1%3a6.6p1-2ubuntu2.3_i386.deb ...
Unpacking openssh-sftp-server (1:6.6p1-2ubuntu2.3) ...
Selecting previously unselected package openssh-server.
Preparing to unpack .../openssh-server_1%3a6.6p1-2ubuntu2.3_i386.deb ...
Unpacking openssh-server (1:6.6p1-2ubuntu2.3) ...
Selecting previously unselected package python-urllib3.
Preparing to unpack .../python-urllib3_1.7.1-1ubuntu3_all.deb ...
Unpacking python-urllib3 (1.7.1-1ubuntu3) ...
Selecting previously unselected package python-requests.
Preparing to unpack .../python-requests_2.2.1-1ubuntu0.3_all.deb ...
Unpacking python-requests (2.2.1-1ubuntu0.3) ...
Selecting previously unselected package ssh-import-id.
Preparing to unpack .../ssh-import-id_3.21-0ubuntu1_all.deb ...
Unpacking ssh-import-id (3.21-0ubuntu1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot
Processing triggers for ufw (0.34~rc-0ubuntu2) ...
Setting up libck-connector0:i386 (0.4.5-3.1ubuntu2) ...
Setting up openssh-client (1:6.6p1-2ubuntu2.3) ...
Setting up ncurses-term (5.9+20140118-1ubuntu1) ...
Setting up openssh-sftp-server (1:6.6p1-2ubuntu2.3) ...
Setting up openssh-server (1:6.6p1-2ubuntu2.3) ...
Setting up python-urllib3 (1.7.1-1ubuntu3) ...
Setting up python-requests (2.2.1-1ubuntu0.3) ...
Setting up ssh-import-id (3.21-0ubuntu1) ...
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Processing triggers for ureadahead (0.100.0-16) ...
Processing triggers for ufw (0.34~rc-0ubuntu2) ...

Creating SSH2 RSA key; this may take some time ...
Creating SSH2 DSA key; this may take some time ...
Creating SSH2 ECDSA key; this may take some time ...
Creating SSH2 ED25519 key; this may take some time ...
ssh start/running, process 2103
查看執行程序:
$ ps aux | grep ssh
root 2103 0.0 0.9 7804 4968 ? Ss 03:15 0:00 /usr/sbin/sshd -D

安裝後可用 PieTTY 執行 SSH 連線: Ubuntu_SSH_OpenSSH_Install_PieTTY

另外可使用 WinSCP 來執行 SFTP 連線: Ubuntu_SSH_OpenSSH_Install_WinSCP

參考連結:

PieTTY
WinSCP

沒有留言:

張貼留言