LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-01-2012, 10:31 PM   #1
jit2d
LQ Newbie
 
Registered: Feb 2012
Posts: 5

Rep: Reputation: Disabled
Unhappy ssh with username and password in the command itselt


I am using ZOC to automate some work. I want to ssh to a server with a given IP providing the useername and password. I am using the following command.

Call ZOCSetDevice "SSH"
Call ZOCConnect "adv: pass1111@10.168.1.33"

The command works fine except when password contains '@' sign. how to pass the password in the above command with '@' sign also so the command looks like

Call ZOCConnect "adv:'pass1111@123'@10.168.1.33"
 
Old 02-02-2012, 12:19 AM   #2
rustek
Member
 
Registered: Jan 2010
Location: Melbourne, IA, USA
Distribution: Ubuntu
Posts: 93

Rep: Reputation: 8
What version are you using?
I don't know if this will help, I did a quick search and this caught my eye.


Quote:
ZOC changelog

ZOC 6.34 released Nov 20, 2011 (New Release)
· CHG: ctrl+f in host directory now brings up search dialog
· FIX: possible crash when scrolling
· FIX: possible error importing old hostdirectories
· FIX: quirk in VT220 (when sending f-keys with eightbit-CSI)
· FIX: TN3270 did not allow to enter comma in numeric fields
· FIX: crash when trying to open more than 64 tabs
· FIX: minor quirk in SSH username/password dialog

ZOC 6.33 released Oct 24, 2011 (New Release)
· NEW: support for KOI8-R codepage
· FIX: possible crash when editing SSH tunnels
· FIX: double click to mark word now wraps around line ends
· FIX: minor quirk with quot;send quotedquot; function
· FIX: minor quirk with special characters in passwords in REXX ZocConnect command
· FIX: possible SCP upload problem (truncated file) over DSL connections
· FIX: host directory item's script was not called when doing a reconnect
 
Old 02-02-2012, 12:24 AM   #3
jit2d
LQ Newbie
 
Registered: Feb 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I am using ZOC 6.35. Any Idea how to pass special characters in password field.
 
Old 02-02-2012, 02:58 AM   #4
lithos
Senior Member
 
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Hi,

there is probably not any trouble with ZOC (as it is only a terminal client)
but your server's shell prompt (it can be SH, BASH, KSH)
and you should try to escape (quote) special characters so the shell doesn't interpret them as some vars or something, but a literal character:
- could be that you need this \@:
Code:
 "adv:'pass1111\@123'@10.168.1.33"    <-- see there \@ in password
Quote:
The special parameters * and @ have special meaning when in double quotes, but you can disable them with the backslash:
echo "*"
echo "\*"
echo "\@"
some BASH escape tutorials:
- quoting
- bash escape
- escape sequences
- bash escaping characters

good luck

Last edited by lithos; 02-02-2012 at 03:03 AM.
 
Old 02-08-2012, 02:04 AM   #5
jit2d
LQ Newbie
 
Registered: Feb 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
I think the problem is not with @ sign but with ! sign as after ! sign the password is not read. So how to pass on ! sign in the password field. the single quote and double quote does not help.
 
Old 02-08-2012, 02:16 AM   #6
fukawi1
Member
 
Registered: Apr 2009
Location: Melbourne
Distribution: Fedora & CentOS
Posts: 854

Rep: Reputation: 193Reputation: 193
I am just going to throw this out there, your intention is a bad practice, from a security standpoint, sending a password as a command line argument is a bad idea.

The most obvious reason being that the shell most likely stores a history of entered commands, viewing that history would reveal your password in plain text.
Another reason, is the password isn't redacted, to hide the password characters (most often with "*"), which means it could easily be shoulder surfed.

I would suggest using public key authentication for ssh connections where entering a password manually isn't possible (ie: via a script).
 
Old 02-08-2012, 02:32 AM   #7
jit2d
LQ Newbie
 
Registered: Feb 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
password is known to all and so password visibility is not my concern. I am just doing health Check of some servers and to login to the server i am using the script to get the output. Then a excel macro is run to get the output in desired format.
 
Old 02-08-2012, 04:19 AM   #8
Ramurd
Member
 
Registered: Mar 2009
Location: Rotterdam, the Netherlands
Distribution: Slackwarelinux
Posts: 703

Rep: Reputation: 111Reputation: 111
Still, the method of passing the password as a parameter is not the thing you should really want.

With ssh-keygen you can create a public/private keypair, and use that to use automated connections. It works without any hassle, even if the password would change for some obscure reason or another. You'd help yourself greatly to use the regular solutions unless such things are not possible at all...
 
Old 02-08-2012, 04:24 AM   #9
jit2d
LQ Newbie
 
Registered: Feb 2012
Posts: 5

Original Poster
Rep: Reputation: Disabled
ssh keygen is not possible and only solution is by plain old username and password only.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
SSH without asking for username or password killthebabysitter Linux - Security 9 08-29-2011 01:27 PM
how to ssh to server without username and password prasanth.george Red Hat 1 01-21-2011 10:17 AM
command line download accelerator with username and password support? steve51184 Linux - Server 4 07-18-2008 11:03 AM
Adding SSH username/password Temujin_12 *BSD 1 12-31-2004 10:36 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration