Using ssh to add register key on ssh server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Using ssh to add register key on ssh server
# 8  
Old 12-21-2009
It also failed.

Code:
C:\>ssh ADM_B 'REG ADD "HKLM\Software\My Co" /v cat /t REG_SZ /d 100 /f'
ERROR: Invalid syntax.
Type "REG ADD /?" for usage.



---------- Post updated at 11:25 AM ---------- Previous update was at 10:42 AM ----------

Quote:
Originally Posted by pludi
In your two examples, this is what REG sees as it's arguments:
  1. ADD
  2. HKLM\Software\My Co
  3. /v
  4. Data
  5. /t
  6. REG_SZ
  7. /d
  8. 100
  9. /f

However, since to the Windows "shell" being very, very, very limited and not allowing nested quotes, this is what your ssh command looks like:
  1. ADM_B
  2. REG
  3. ADD
  4. HKLM\Software\My
  5. Co
  6. /v
  7. cat
  8. /t
  9. REG_SZ
  10. /d
  11. 100
  12. /f

But since you've apparently got Cygwin installed anyways, use the Bash shell that's installed with it, since this shell knows about different types of quotes and how to nest them.
I tried to run the same command line under Bash shell. But it still failed and got the same result. It seems that double quotes are needed, but ssh still doesn't like space character.

Code:
bash-3.2$ ssh ADM_B REG ADD "HKLM\Software\My Co" /v cat /t REG_SZ /d 100 /f
ERROR: Invalid syntax.
Type "REG ADD /?" for usage.

bash-3.2$ ssh ADM_B REG ADD "HKLM\Software\MyCo" /v cat /t REG_SZ /d 100 /f
The operation completed successfully.

bash-3.2$ ssh ADM_B REG ADD HKLM\Software\MyCo /v cat /t REG_SZ /d 100 /f
ERROR: Invalid key name.
Type "REG ADD /?" for usage.

# 9  
Old 12-21-2009
Try
Code:
ssh ADM_B REG ADD "HKLM\Software\My\ Co" /v cat /t REG_SZ /d 100 /f

# 10  
Old 12-22-2009
It failed too.

Code:
bash-3.2$ ssh ADM_B REG ADD "HKLM\Software\My\ Co" /v cat /t REG_SZ /d 100 /f
ERROR: Invalid syntax.
Type "REG ADD /?" for usage.

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Help ssh key fail on remote server

Hello everyone, I need some help writing a bash script to: 1. ssh from a jumpserver to 50 remote servers logging in automatically using ssh keys and capture if zabbix is running by running a "ps -ef | grep zabbix" and output to a logfile capturing the server hostname and ps -ef output to... (2 Replies)
Discussion started by: vtowntechy
2 Replies

2. Cybersecurity

get ssh key comment

Hey Guys, I have a server, and a technical user on it (only for reading logs). I set up openssh, and the user can login only with ssh key pair. Under this one technical user, there are a lots of public keys in the ~/.ssh/authorized_keys file. I would like to find out/log with which key the user... (3 Replies)
Discussion started by: lyynxxx
3 Replies

3. Solaris

Solaris 8 ssh public key authentication issue - Server refused our key

Hi, I've used the following way to set ssh public key authentication and it is working fine on Solaris 10, RedHat Linux and SuSE Linux servers without any problem. But I got error 'Server refused our key' on Solaris 8 system. Solaris 8 uses SSH2 too. Why? Please help. Thanks. ... (1 Reply)
Discussion started by: aixlover
1 Replies

4. Shell Programming and Scripting

Generate Public Key when the server is not ssh enabled

I am writing a script that needs to access various servers some of which are not ssh enabled. In order to access the ssh enabled servers I am using the following command to generate the public key : ssh-keygen -t rsa Is there a similar command for the other servers as well. If I try to use... (1 Reply)
Discussion started by: ravneet123
1 Replies

5. UNIX for Advanced & Expert Users

ssh key

Hi all, I have a sshkey which I use to connect from my unix box to a linux box without any issue...... however I downloaded this same key to my laptop and tried to connect to the same linux box but it failed..... As my laptop is running MS Vista I guessing I going have to convert it ...... (1 Reply)
Discussion started by: Zak
1 Replies

6. AIX

SSH has this error: "server refused our key"

I did successful yestday as Porter's doc: 1. Create private/pub key on AIX: $ssh-keygen -t identity 2. Get my private key from the AIX server, found in $HOME/.ssh/identity Put that on Windows box. I use WinSCP to transfer private key from AIX to Windows 3. Run puttygen.exe and... (8 Replies)
Discussion started by: rainbow_bean
8 Replies

7. Cybersecurity

SSH key code versus server key code

Hi, When logging in using SSH access (to a remotely hosted account), I received a prompt to accept a server's key fingerprint. Wrote that string of code down for comparision. Already emailed my host for their listing of the string of code for the server's key fingerprint (for comparison,... (1 Reply)
Discussion started by: Texan
1 Replies

8. AIX

key ssh

hello I want to connect from server1 to server2 (Aix 5.3) with ssh, without password prompt. So i define a ssh-key On server1: ssh-keygen -b 1024 -f identity -P '' -t dsa scp identity.pub toto@server2:/tmp/identity-.pub On server 2: cat identity-.pub >> .ssh/authorized_keys chmod 400... (2 Replies)
Discussion started by: pascalbout
2 Replies

9. Cybersecurity

What's the difference between an SSH Client and an SSH Server?

Eh... yeah. What the title says. :D (1 Reply)
Discussion started by: PSC
1 Replies

10. UNIX for Advanced & Expert Users

Add users on OSX server with SSH

Hi Is it possible to add users on a Mac OSX server from a unix system with ssh? If it is what file to alter? brg Nicke (3 Replies)
Discussion started by: nicke30
3 Replies
Login or Register to Ask a Question