SSH w/ command in authorized_keys apparently needs pty
I'm trying to have an unattended remote PC log some data on home PC. man sshd says I should be able to put a command in authorized_keys.
This is what I have on the remote machine. The key is a special key that isn't used elsewhere.
In my ~/.ssh/authorized_keys file on my desktop:
Then to write the data, I issue this command on the remote machine, where desk_pc is the IP of my desk PC:
I think this should work, but it doesn't.
I think my desktop it's trying execute the received text instead of cat it to the log file. This is displayed on the remote machine:
Do I need a pty? How can I get stdin written to a file without a pty if I need one?
How do I get it to execute the /bin/cat command, not the received text?
Hi all,
today I could not telnet in AIX 5.2 cause I received the error
"telnetd: All network ports in use".
To allow users to telnet again I increased the number of ptys from default 256 to the new number 512.
To avoid the same problem in the future and for a better understanding, I need... (2 Replies)
Hi,
We have around 200 SUN Servers in production environment and I have one box from where I manage all the servers. It's setup such that I can SSH from my box onto all the 200 servers with without supplying password. It is working fine but sometimes we notice the keys getting changed and asking... (0 Replies)
Hi,
We have around 200 SUN Servers in production environment and I have one box from where I manage all the servers. It's setup such that I can SSH from my box onto all the 200 servers with without supplying password. It is working fine but sometimes we notice the keys getting changed and asking... (1 Reply)
Hi,
According to my understanding tty files that are available in /dev directory are terminals that are given to different users.
please help me understand what are /pty files, like are they drivers to the devices..
also is the default tty terminal given to a user.. (2 Replies)
I've been experimenting with pseudo-terminals and found something I don't quite understand. Writing an EOF character to the master end doesn't work quite as I expect. Once I've written any other data, the master pty seems to treat a single ^D as a seperator, i.e. writing "abcabc" would let cat do... (1 Reply)
Discussion started by: Corona688
1 Replies
7. Post Here to Contact Site Administrators and Moderators
I previously posted a question in the Shell Scripting forum a few minutes ago. I recieved a message telling me I had breached a rule, apparently because my post was a homework infraction. Well, im currently trying to figure out how to use Raspberry Pi's (as im a starter)
I asked one of my... (1 Reply)
Hi
I have an ssh 'for' loop script to login and put a key on multiple servers. I need to append a file on each server but the command which works ok from the prompt does not work via the script. I have
cat filename | ssh user@servername "cat >>append.file.name"
I have tried to 'spawn' this in... (0 Replies)
Hi,
I copied the key of rsa.pub to authorized_keys using the below command
cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
By mistake i have executed another command
view cat /root/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys
so now additional keys are copied.so please help me... (3 Replies)
Discussion started by: SA_Palani
3 Replies
LEARN ABOUT SUSE
ssh-keyconverter
SSH-KEYCONVER(1) BSD General Commands Manual SSH-KEYCONVER(1)NAME
ssh-keyconvert -- convert ssh v1 keys and authorization files
SYNOPSIS
ssh-keyconvert [-k] [-o output_file] identity_file ...
ssh-keyconvert [-a] [-o output_file] authorization_file ...
DESCRIPTION
ssh-keyconvert converts RSA public and private keys used for public key based user authentication with protocol version 1 to the format used
with protocol version 2.
When using RSA user authentication with SSH protocol version 1, the client uses the private key from $HOME/.ssh/identity to provide its iden-
tity to the server. The server grants or denies access based on whether the public part of this key is listed in $HOME/.ssh/authorized_keys.
SSH protocol version 2 supports both DSA and RSA keys, but the way RSA keys are stored are differently. On the client, the default file name
is .ssh/id_rsa rather than .ssh/identity, and the file's format is different as well. On the server, the public porting of the key can still
be stored in .ssh/authorized_keys, but the key notation has changed as well. Therefore, when switching from protocol version 1 to version 2,
you either have to create a new identity key using ssh-keygen(1) and add that key to the server's authorized_keys file, or you need to con-
vert your keys using ssh-keyconvert.
By default, ssh-keyconvert will try to guess the type of file that is to be converted. If it fails to guess correctly, you can tell if what
type of conversion to perform by specifying the -k option to convert the private key, or the -a option to convert an authorisation file.
When converting your private keys stored in .ssh/identity, ssh-keyconvert will read the private key, prompting you for the pass phrase if the
key is protected by a pass phrase. If the -o option is given, it will write the private key to the specified file, using version 2 syntax. If
the key was protected by a pass phrase, it will use the same pass phrase to protect the new file. It will also write the public portion of
the key to a second file, using the specified file name with ``.pub'' appended. If the -o option was not given, private and public key will
be written to id_rsa and id_rsa.pub, respectively, relative to the directory of the input key file.
If the destination file already exists, ssh-keyconvert will prompt the user for confirmation before overwriting the file, unless the -f
option is given.
When converting your authorized_keys file, ssh-keyconvert will ignore any keys in SSH version 2 format. Any public keys in version 1 format
will be converted and appended to the output file using the new syntax. If the -o option is given, keys are appended to the specified file.
If it is not given, ssh-keyconvert will append all keys to the input file.
Note that ssh-keyconvert does not check for duplicate keys, so if you run it on .ssh/authorized_keys more several times, the converted keys
will show up several times.
OPTIONS -k Convert private key file(s). The default is to guess the type of file that should be converted.
-a Convert authorized_keys file(s). The default is to guess the type of file that should be converted.
-o outfile
Specify the name of the output file. When converting an authorization file, all public keys will be appended to this file. For pri-
vate key conversion, the private and public components of the key will be stored in outfile and outfile.pub, respectively. Note that
since every key must be stored in a separate file, you cannot use this option when you specify several input files.
-f When converting a key file, and the output file already exists, ssh-keyconvert will ask the user whether to overwrite the file. Using
this option forces overwriting.
AUTHORS
OpenSSH is a derivative of the original and free ssh 1.2.12 release by Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
Theo de Raadt and Dug Song removed many bugs, re-added newer features and created OpenSSH. ssh-keyconvert was contributed by Olaf Kirch.
SEE ALSO ssh(1), ssh-add(1), ssh-agent(1), sshd(8)
J. Galbraith and R. Thayer, SECSH Public Key File Format, draft-ietf-secsh-publickeyfile-01.txt, March 2001, work in progress material.
BSD February 2, 2002 BSD