reference: https://blog.csdn.net/ghostar03/article/details/47441715
https://blog.csdn.net/u011186256/article/details/79963544
要用SecureCRT連接Ubuntu,在linux中ssh程序分為 :openssh-client和 openssh-server。如果需要ssh登陸到別的電腦,需要安裝openssh-client,該程序ubuntu是默認安裝的。而如果需要從遠程連接到本機,則需要安裝openssh-server,該程序需要自己安裝。
環境:windows10、虛擬機Ubuntu 18.04
協議:SSH2
windows端軟件:SecureCRT
Ubuntu端軟件:openssh-server
Windows端使用:
創建鏈接
新建鏈接:
選擇通信協議:
然后根據IP設置
Ubuntu端安裝:
1、首先要安裝ssh功能:
sudo apt-get install openssh-server
此時出現錯誤--Could not get lock /var/lib/dpkg/lock
接着在終端輸入:
sudo rm /var/lib/dpkg/lock
然后再運行安裝代碼
sudo apt-get install openssh-server
sudo apt-get install openssh-client
查看openssh-server是否啟動
$ ps-e | grep sshd 或ssh
啟動ssh服務
2、修改配置文件
sudo pico /etc/ssh/ssh_config
去掉PasswordAuthenitcation, Port 22,Protocol2,1這三行前的注釋#
運行發現
秘鑰交互失敗,需要修改相關配置文件:
將ssh_config文件中的
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
復制到sshd_config文件中,然后重啟服sshd服務器
/etc/init.d/ssh restart
連接成功:
解決中文亂碼問題,選擇外觀-字符編碼(UTF-8):
現在我們已經可以正常連接使用我們虛擬的Linux,但是現在還有一個問題,我們怎么在他們直接傳輸文件呢,有人說可以設立共享文件夾,可是如果是VPS主機的話怎么辦呢?
下面介紹一個經典的文件傳輸的工具rz(上傳)和sz(下載)
有的ubuntu源里面可能沒有了,如果有的話可以方便的直接安裝
sudo apt-get install lrzsz
可是如果源里面沒有怎么辦呢,沒關系,下面說怎么安裝
1、下載源碼
wgethttp://down1.chinaunix.net/distfiles/lrzsz-0.12.20.tar.gz
2、tar zxvf lrzsz-1.12.20.tar.gz
3、cd lrzsz-1.12.20
4、./configure–prefix=/usr/local/lrzsz
5、make
6、make install
7、建立符號連接
#cd /usr/bin
#ln -s /usr/local/lrzsz /bin/lrz rz
#ln -s /usr/local/lrzsz /bin/lsz sz
8、試試
當在SecureCRT里面運行rz 的時候就會彈出SecureCRT上傳窗口,文件會傳到當前的目錄了。
Ps:可以管理多個linux主機哦,那你就擁有一個Linux主機集群啦。