连接AWS EC2 Linux instance Ubuntu远程桌面

创建了AWS EC2 Linux instance Ubuntu,记录下通过本地Windows远程访问AWS Ubuntu桌面的方法。 1, 更新,升级和安装准备 sudo apt-get update sudo apt-get upgrade 2,配置sshd_config允许密码访问 sudo emacs /etc/ssh/sshd_config 将 PasswordAuthentication 选项设置为yes # Change to no to disable tunnelled clear text passwords #PasswordAuthentication no PasswordAuthentication yes 3,重启SSH伺服让配置生效 sudo /etc/init.d/ssh restart 4,为用户名ubuntu设置密码 sudo –i passwd ubuntu su ubuntu 5,为Ubuntu Linux Instance安装桌面功能 大概需要十多分钟, export DEBIAN_FRONTEND=noninteractive sudo -E apt-get update sudo -E apt-get install -y ubuntu-desktop 6,安装XRDP和其它xfce4资源 sudo apt-get install xfce4 xrdp sudo apt-get install xfce4 xfce4-goodies 7,设置xfce4为RDP连接的默认window manager echo xfce4-session > ~/.xsession 8,拷贝.xsession 到 /etc/skel 目录 这样新的用户名被创建的时候,xfce4 自动被设置为默认的 window manager sudo cp /home/ubuntu/.xsession /etc/skel 9,修改xrdp.ini配置文件 当进行远程连接时允许改变主机端口,在 [xrdp1]区 port=-1 改为: port=ask-1 10,重启xrdp sudo service xrdp restart 11,在本地Windows端进行连接 打开Remote Desktop Connection, 输入Public DNS,点连接, 在“Login to xrdp”界面输入sesman-Xvnc, ubuntu和先前设置的密码,端口设置为-1,点OK 连接成功如下图所示: 参考链接: 1, Connect to an Amazon EC2 Linux instance with desktop functionality from Windows 2, How-to-set-up-gui-on-amazon-ec2-ubuntu-server

AWS attach additional disk

The AWS disk was used up very fast, added additional volumes, The disk usage as below, [root@ip-172-31-2-32 ec2-user]# df -l Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda2 10473452 8020612 2452840 77% / devtmpfs 484472 0 484472 0% /dev tmpfs 507736 20 507716 1% /dev/shm tmpfs 507736 57588 450148 12% /run tmpfs 507736 0 507736 0% /sys/fs/cgroup tmpfs 101548 0 101548 0% /run/user/1000 First you need to add the volumes, added two additional disk, Block devices /dev/sda1 /dev/sdb /dev/sdc Then create ext4 file system on the volume, sudo mkfs -t ext4 /dev/sdb sudo mkfs -t ext4 /dev/sdb Create the mount point: mkdir /home/ec2-user/data mkdir /home/rongrong/data mount the device to the point created: mount /dev/xvdb /home/ec2-user/data mount /dev/xvdc /home/rongrong/data update /etc/fstab to make it auto mount, added two lines, /dev/xvdc /home/rongrong/data ext4 defaults,nofail 0 2 /dev/xvdb /home/ec2-user/data ext4 defaults,nofail 0 2 command mount -a mount -a check the disk usage again: