I tried adding the sudo, enter password, and after a couple of “Loading bundle…” I get:
Mon Sep 15 08:00:36 mini.local OSXvnc-server[197] : 3891612: (connectAn dCheck) Untrusted apps are not allowed to connect to or launch Window Server bef ore login.
2008-09-15 08:00:36.263 OSXvnc-server[197:a0b] screen format not supported.
To launch Vine Server before ANY user has logged in on 10.5 you MUST use LaunchD. That is what the System Server does for you when you configure it with the Vine Server GUI. To do that from the command line (via SSH) you will need to upload a Launch Agent configuration file and then use the launchctl command.
Attached is a SAMPLE file that you should modify based on your needs and place in /Library/LaunchAgents
You can pull this file to your remote machine with CURL:
That will get you to the login screen but at least for me kills the VNC session after you log in. You have to wait about 20 seconds for launchctl to restart Vine automatically; you can watch it happen in /var/log/system.log
See ChinaUnix above a users post, like in linux when to use ssh login without a password each time, they can not use the key way.
Web search for a moment, there are users expect to write with an automatic logon script, but after I tried, but found that can not be used.
Then to see people that use sshpass can solve the problem. So, if you write a script. Script written in simple, do not consider security issues. To use this script to install sshpass the software.
sshlogin.sh:
#! / Bin / bash
#================================================= ==============================
FILENAME:
Sshlogin.sh
DESCRIPTION:
Script to use user and password from config file to login remote
Ssh server.
This script needs 1 argument to login the remote ssh server:
Ipaddr = IP Addreess of remote ssh server.
For example:
#. / Sshlogin.sh 192.168.0.1
You need to create a config file (pass.dat) with entries like:
#------------------------------------------------- -----------------------------
print_usage ()
(
echo “Usage: $ 1”
exit 1
)
[$ #-Eq 1] | | print_usage $ 0
CONFIG_FILE = pass.dat
SERVER = $ 1
ipaddr = “”
username = “”
password = “”
found = 0
while read line; do
ipaddr = $ (echo $ line | cut-d ‘|’-f1)
username = $ (echo $ line | cut-d ‘|’-f2)
password = $ (echo $ line | cut-d ‘|’-f3)
if ["$ SERVER" == “$ ipaddr”]; then
# The server found!
found = 1
break
fi
done <$ CONFIG_FILE
if [$ found-eq 0]; then
echo “The server not found!”
exit 2
fi
if [-z “$ password”] | | [-z “$ ipaddr”] | | [-z “$ username”]; then
echo “Invalid config file: $ CONFIG_FILE!”
exit 3
fi
echo “Logining (ssh) $ username @ $ ipaddr …”
sshpass-p “$ password” ssh $ username @ $ ipaddr
exit 0
In addition to a record passwords, user names and ssh server IP file pass.dat:
pass.dat:
192.168.0.1 | root | a123B56
192.168.0.2 | root | 7X890Yz
Another problem is that if the first login with ssh when a particular server, ssh will prompt:
The authenticity of host '192 .168.0.1 (192.168.0.11) 'can’t be established.
RSA key fingerprint is 7b: b9: c3: cd: 01: cd: 2f: 19:4 e: 96: d3: 66:27:55:7 f: 65.
Are you sure you want to continue connecting (yes / no)?
The above script does not deal with this situation, interested friends, try to improve what it can own.