Ubuntu16配置SSH登錄遠程服務器

1)安裝ssh

命令:

sudo apt-get install openssh-server

實際操作效果如下圖所示:

2)驗證ssh,查看是否有sshd, 出現sshd說明ssh服務已經啓動

命令:

sudo ps -e |grep ssh 

實際操作圖如下:

3)配置文件,將文件中PermitRootLogin prohibit-password註釋掉,並添加一行 PermitRootLogin yes 保存

命令:

sudo gedit /etc/ssh/sshd_config

4) 安裝 putty

命令:

sudo apt-get install putty

5)鏈接服務器

命令:

putty

 進入下面的界面配置好信息即可鏈接遠程服務器

6)上傳文件到遠程服務器(在本地終端操作)

命令形式:

scp local_file remote_username@remote_ip:remote_folder

local_file:你要上傳的文件(包含進路徑)

remote_username:遠程服務器上你的賬號名

remote_ip:遠程服務器的ip地址

remote_folder:服務器上你要上傳文件進去的文件夾(包含進路徑)

7)從遠程服務器下載文件到本地命令和6)中命令相反相反

參考資料:

https://blog.csdn.net/jasonzhoujx/article/details/81603761

https://linuxtools-rst.readthedocs.io/zh_CN/latest/tool/scp.html

 

 

 

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章