Upload aliyun_config.sh
Browse files- aliyun_config.sh +17 -7
aliyun_config.sh
CHANGED
@@ -42,9 +42,10 @@ sudo apt-get install -y xserver-xorg-video-dummy
|
|
42 |
echo "Setting up VNC password..."
|
43 |
mkdir -p ~/.vnc
|
44 |
|
45 |
-
# Create VNC password file using
|
46 |
echo "Creating VNC password file..."
|
47 |
-
echo "osworld-public-evaluation"
|
|
|
48 |
chmod 600 ~/.vnc/passwd
|
49 |
|
50 |
# Verify password file was created
|
@@ -173,6 +174,14 @@ sleep 2
|
|
173 |
# Set DISPLAY environment variable
|
174 |
export DISPLAY=:0
|
175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
# Start x11vnc with password
|
177 |
echo "Starting x11vnc..."
|
178 |
x11vnc -display :0 -rfbport 5900 -forever -shared -noxdamage -noxfixes -noxrandr -rfbauth ~/.vnc/passwd &
|
@@ -201,22 +210,22 @@ netstat -tlnp | grep -E "(5900|5910)"
|
|
201 |
echo ""
|
202 |
echo "VNC services started!"
|
203 |
echo "Connect via: http://<server-ip>:5910"
|
204 |
-
echo "
|
205 |
EOF
|
206 |
|
207 |
chmod +x ~/start_vnc.sh
|
208 |
|
209 |
echo "=== Setup Complete ==="
|
210 |
echo ""
|
211 |
-
echo "✅ VNC password has been set
|
212 |
echo "✅ SSH service has been enabled and started"
|
213 |
echo "✅ SystemD services have been created and enabled"
|
214 |
echo "✅ Manual startup script created: ~/start_vnc.sh"
|
215 |
echo ""
|
216 |
echo "Connection methods:"
|
217 |
echo "- SSH: ssh user@<server-ip> (use system user password)"
|
218 |
-
echo "- VNC client: <server-ip>:5900 (password
|
219 |
-
echo "- noVNC web: http://<server-ip>:5910 (password
|
220 |
echo ""
|
221 |
echo "To start VNC services manually:"
|
222 |
echo " ./start_vnc.sh"
|
@@ -227,4 +236,5 @@ echo " systemctl --user start novnc.service"
|
|
227 |
echo ""
|
228 |
echo "SSH service is running on port 22"
|
229 |
echo ""
|
230 |
-
echo "
|
|
|
|
42 |
echo "Setting up VNC password..."
|
43 |
mkdir -p ~/.vnc
|
44 |
|
45 |
+
# Create VNC password file using interactive method
|
46 |
echo "Creating VNC password file..."
|
47 |
+
echo "Please enter VNC password when prompted (recommended: osworld-public-evaluation)"
|
48 |
+
x11vnc -storepasswd ~/.vnc/passwd
|
49 |
chmod 600 ~/.vnc/passwd
|
50 |
|
51 |
# Verify password file was created
|
|
|
174 |
# Set DISPLAY environment variable
|
175 |
export DISPLAY=:0
|
176 |
|
177 |
+
# Check if password file exists
|
178 |
+
if [ ! -f ~/.vnc/passwd ]; then
|
179 |
+
echo "VNC password file not found. Creating one..."
|
180 |
+
echo "Please enter VNC password when prompted:"
|
181 |
+
x11vnc -storepasswd ~/.vnc/passwd
|
182 |
+
chmod 600 ~/.vnc/passwd
|
183 |
+
fi
|
184 |
+
|
185 |
# Start x11vnc with password
|
186 |
echo "Starting x11vnc..."
|
187 |
x11vnc -display :0 -rfbport 5900 -forever -shared -noxdamage -noxfixes -noxrandr -rfbauth ~/.vnc/passwd &
|
|
|
210 |
echo ""
|
211 |
echo "VNC services started!"
|
212 |
echo "Connect via: http://<server-ip>:5910"
|
213 |
+
echo "Use the password you set during setup"
|
214 |
EOF
|
215 |
|
216 |
chmod +x ~/start_vnc.sh
|
217 |
|
218 |
echo "=== Setup Complete ==="
|
219 |
echo ""
|
220 |
+
echo "✅ VNC password has been set interactively"
|
221 |
echo "✅ SSH service has been enabled and started"
|
222 |
echo "✅ SystemD services have been created and enabled"
|
223 |
echo "✅ Manual startup script created: ~/start_vnc.sh"
|
224 |
echo ""
|
225 |
echo "Connection methods:"
|
226 |
echo "- SSH: ssh user@<server-ip> (use system user password)"
|
227 |
+
echo "- VNC client: <server-ip>:5900 (use the password you set)"
|
228 |
+
echo "- noVNC web: http://<server-ip>:5910 (use the password you set)"
|
229 |
echo ""
|
230 |
echo "To start VNC services manually:"
|
231 |
echo " ./start_vnc.sh"
|
|
|
236 |
echo ""
|
237 |
echo "SSH service is running on port 22"
|
238 |
echo ""
|
239 |
+
echo "IMPORTANT: The VNC password was set interactively during setup."
|
240 |
+
echo "If you forget it, run: x11vnc -storepasswd ~/.vnc/passwd to reset it."
|