Ubuntu 15.04 基本設定

Ubuntu 15.04 基本設定

比較少碰Ubuntu系統 就把指令記下來吧

1.設定IP、DNS
2.安裝VMware Tools
3.安裝OpenSSH
4.安裝XRDP
5.移除不必要的服務
6.設定反向Tunnel連線
1.設定IP、DNS

sudo vi /etc/network/interfaces
auto eth0
iface eth0 inet static
address 172.16.1.6
netmask 255.255.255.0
gateway 172.16.1.1
dns-nameservers 8.8.8.8 168.95.1.1
sudo /etc/init.d/networking restart
測試網路
ping tw.yahoo.com
2.安裝VMware Tools
sudo mount -t iso9660 /dev/cdrom /mnt
cd /mnt;cp VMwareTools-9.4.10-2068191.tar.gz /tmp/
cd /tmp/ ;tar -xzf VMwareTools-9.4.10-2068191.tar.gz
執行安裝
 sudo /tmp/vmware-tools-distrib/vmware-install.pl
3.安裝OpenSSH
更新新版本的套件
sudo apt-get update
安裝OpenSSH
sudo apt-get remove openssh-server
設定SSH KEY
4.安裝XRDP
sudo apt-get install xrdp
安裝xfce4 桌面環境
sudo apt-get install xfce4
設定XRDP使用xfce4 桌面環境
echo xfce4-session >~/.xsession
設定重新連線回到相同桌面環境
sudo vi /etc/xrdp/xrdp.ini
[xrdp1]
name=sesman-Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=ask-1
5.移除不必要的服務
關閉cupsd

sudo systemctl stop cups.socket
sudo systemctl stop cups.path
sudo systemctl stop cups.service

設定開機不啟動

sudo systemctl disable cups.service
Synchronizing state for cups.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d cups defaults
Executing /usr/sbin/update-rc.d cups disable
insserv: warning: current start runlevel(s) (empty) of script `cups' overrides LSB defaults (2 3 4 5).
insserv: warning: current stop runlevel(s) (1 2 3 4 5) of script `cups' overrides LSB defaults (1).
Removed symlink /etc/systemd/system/sockets.target.wants/cups.socket.
Removed symlink /etc/systemd/system/multi-user.target.wants/cups.path.

6.設定反向Tunnel連線
通常使用在不開放外對內的NAT架構,如下:

 

 

 

 

 

 

 

 

先從SSH Server A 透過SSH反向Tunnel 連線到 SSH Server B
SSH Server B 透過這一筆反向Tunnel 連到SSH Server A

SSH Server B 設定
建立keypair,Ubuntu 不要使用sudo否則會產生root 金鑰

ssh-keygen -t rsa

確認金鑰(id_rsa & id_rsa.pub),並把Public Key 改為authorized_keys

cd .ssh/ ; ls ; cat id_rsa.pub >> authorized_keys

修改權限

chmod 600 authorized_keys

將私鑰放入SSH Server A

SSH Server A 設定
為了避免SSH斷線,先安裝autossh

yum install autossh

建立免密碼的Autossh 連線

autossh -M 5354 -2NCf -R 6678:127.0.0.1:22 [email protected] -p 22 -i  id_rsa

SSH Server B 設定
檢查連線是否建立

sudo netstat -tunalp | grep 6678
tcp        0      0 127.0.0.1:6678          0.0.0.0:*               LISTEN      27430/sshd: user

SSH Server B 連到Server A

ssh [email protected] -p 6678
Facebook Comments
machine rape hentai hentaihug.com read hentai magna
ladki chodna pornude.mobi bluefilm com video
hindi video new pornozavr.me gora aur kala
نيك عنيف مترجم 24h-porn.net ينيكها وهي نايمه
يشبفسثء freebigassporn.org فيلم اجنبى قليل الادب
elizabeth olsen bf blondeporntrends.com malayalam sexi
chudai karwai indiandesiclips.com bhabisex.com
haryana village sex video ganstagirls.net wwwxnxcom
bf sexy vidio indiantubetv.com bhaagamathie songs naa songs
open sex free brownporntube.info open dance
bp hd sexy palimas.mobi xexi movie
malayalifuck dunato.mobi sex vedios malayalam
sexy film video hindi mai collegeporntrends.com tamilplay.com 2015 movies download
hot romantic sex porn alohaporn.net xnxx japnese
دانا فسبولى arabicaporn.com مصريه متناكه