Wednesday, July 09, 2014

Solaris remote public key authorization

Still a pain in Solaris 11. Openssh ssh-copy-id still does not work as expected so the process is manual unless you want to risk having multiple keys authorized for the same host remotely.
#1 Generate local key
ssh-keygen -t rsa -N '' -f /export/home/geneva/.ssh/id_rsa
#2 Authorize it remotely:
cat /export/home/geneva/.ssh/id_rsa.pub | ssh $remoteHost 'cat >> .ssh/authorized_keys && echo "Key copied"'
#3 Go to the remote server to eliminate duplicates:
gawk '!x[$0]++' ~/.ssh/authorized_keys > ~/.ssh/authorized_keys2
mv ~/.ssh/authorized_keys2 ~/.ssh/authorized_keys

Thursday, July 03, 2014

On SMTP: RCPT To: command verb versus to: header

Ever wondered why you got an email with "to:" being some other address and not yours? Perhaps you got an email stating "to: Undisclosed recipients:;", why? you might have asked.

To simplify the explanation here the RCPT command using the verb “to:” is used to direct the email to a specific address. In the last mile the email will be received by the addressee but only the "to:" header if present will be accessible. If it is missing you get "to: Undisclosed recipients:;" and if it is set you get whatever it says. Clearly you can use a different email address there which will generate in some cases a heck of confusion ;-). You can confirm this yourself just by using telnet as usual for SMTP:
# WHEN "RCPT TO:" = "TO:" (to: <me@sample.com>)
MAIL FROM:me@sample.com
250 2.1.0 Sender OK
RCPT TO:me@sample.com
250 2.1.5 Recipient OK
DATA
354 Start mail input; end with <CRLF>.<CRLF>
subject:Using RCPT TO: = to:
to: me@sample.com
# WHEN "RCPT TO:" != "TO:" (to: <who@et.com>)
MAIL FROM:me@sample.com
250 2.1.0 Sender OK
RCPT TO:me@sample.com
250 2.1.5 Recipient OK
DATA
354 Start mail input; end with <CRLF>.<CRLF>
subject:Using RCPT TO: != to:
to: who@et.com
# WHEN "TO:" IS NOT USED (to: Undisclosed recipients:;)
MAIL FROM:me@sample.com
250 2.1.0 Sender OK
RCPT TO:me@sample.com
250 2.1.5 Recipient OK
DATA
354 Start mail input; end with <CRLF>.<CRLF>
subject:Using no to:
.

Tuesday, July 01, 2014

Variable syntax: cshell is picky. Use braces to refer to variables

If cshell (csh) is your default shell after you login ~/.cshrc will be parsed. If you get the error "variable syntax" your next step if to figure out what shell config file is declaring a variable incorrectly. The below is correct:
# braces are needed to avoid "variable syntax" error
setenv PATH $PATH:/usr/sbin:${GVHOME}/bin:/opt/csw/bin:/usr/sfw/bin:/usr/local/bin
Just remove the braces and you will end up with the "variable syntax" error.

Followers