ssh tunnel - remote access through nat

martinko gamato at
Tue Oct 10 15:24:53 PDT 2006

Chuck Swiger wrote:
> On Oct 10, 2006, at 2:55 PM, martinko wrote:
>> [ ... ]
>> The thing is that if I just simply create an rc script to achieve this,
>> the script is run under root and ssh cannot make use of public key
>> authentication which is set up now for a user running it manually.
>> Or is there a way to change identity somehow or to run an rc script
>> under different user account ??
> Of course. One can use "su -" to run a command under another user, or
> use the "ssh -i" option to pass the user's identity (ie, their SSH
> private key) directly...
> ---Chuck

su(1) usually asks for password. but it does not when run by root, of
course. :-)
i like `ssh -i`, too. only that i'll have to check whether it won't
complain that identity file ownership doesn't match user running it.
(which would be root i expect)

also, i've been kindly reminded of cron(8) and its @reboot option.

thank you all for your input! (i'd better go to bed now..;))


More information about the freebsd-questions mailing list