0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

vncserver構築メモ

Posted at

・前提条件
 サクラのVPS
 CentOs7.2
 ローカルOSはMac
 リモート側のユーザー:centos
以下作業

#rootでログイン
ssh root@...

#デスクトップ環境のインストールとVNCサーバ導入、および全体アップデートしリブート
yum -y groupinstall "GNOME Desktop" "Server with GUI" ;yum install tigervnc-server -y ;yum update -y ;reboot

#起動状態監視
ping ...

#rootで再度ログインしVNCユーザ追加
ssh root@...
useradd centos;passwd centos
#ユーザーパスワードを二回入力
Password: ******
Verify: ******

#VNCサーバのユーザ定義作成と定義の再ロード
cp /usr/lib/systemd/system/vncserver@.service /usr/lib/systemd/system/vncserver@:1.service
sed -ie "s//centos/g" /usr/lib/systemd/system/vncserver@:1.service
systemctl daemon-reload

#centsoにユーザチェンジ
su - centos

#centsoでVNC接続する際のパスワードを二回入力
vncpasswd
Password: ******
Verify: ******

#centsoでログイン時にデスクトップ起動定義作成
cd ~/.vnc/;touch xstartup;chmod +x xstartup;echo "#! /bin/sh " >> xstartup;echo "gnome-session & " >> xstartup;cat xstartup

#rootにログアウト
exit

#firewallにVNCサーバ追加
firewall-cmd --permanent --zone=public --add-service=vnc-server
firewall-cmd --permanent --list-all
firewall-cmd --reload

#VNCサーバ自動起動追加
systemctl start vncserver@:1.service;systemctl is-active vncserver@:1.service;systemctl enable vncserver@:1.service;systemctl is-enabled vncserver@:1.service

#ログイン時の認証デバック
echo "X-GNOME-Autostart-enabled=false" >> /etc/xdg/autostart/gnome-software-service.desktop;echo "X-GNOME-Autostart-enabled=false" >> /etc/xdg/autostart/gnome-settings-daemon.desktop;reboot

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?