將ubuntu系統(tǒng)設置為服務器很簡單,只需要開啟ssh服務就可以了。開啟了ssh服務以后,其它電腦就可以通過ssh遠程登錄你的這臺ubuntu服務器。
SSH分客戶端openssh-client和openssh-server,但是ubuntu系統(tǒng)已經默認有openssh-client(作為服務器不需要這個),所以只需要安裝openssh-server就可以達到目的。
1、首先,安裝openssh-server
yum install opens-server

demo
2、查看ssh是否已經開啟
ps -e |grep ssh
小知識積累
ps -s | grep ssh #啟用ssh指令
sudo /etc/init.d/ssh start # 啟動ssh服務
sudo /etc/init.d/ssh stop # 停止ssh服務
sudo /etc/init.d/ssh restart # 重啟ssh服務
3、查看當前主機地址
ifconfig

白色覆蓋的區(qū)域就是主機的ip地址
小知識積累
查看當前主機的ip
Unix/Linux ifconfig
Windows ipconfig
4、連接主機
ssh username@ip
例如ssh guxia@125.42.176.217
username為主機的用戶名,需要輸入密碼,密碼為ubuntu機器上的用戶密碼(執(zhí)行sudo命令需要輸入的那個)。

demo
如果在windows系統(tǒng)登錄,需要下載支持ssh的軟件,putty(端口號為22)。
putty下載地址
鏈接:https://pan.baidu.com/s/1ONkBfYj4SN9Q0L8CccJ5Ww&shfl=sharepset
密碼:mp2r