Sponsored Content
Top Forums Shell Programming and Scripting SSH w/ command in authorized_keys apparently needs pty Post 302537646 by Corona688 on Saturday 9th of July 2011 12:34:56 AM
Old 07-09-2011
how about telling it to execute /bin/cat.

Code:
echo "$(date +%D)  Data ...." | ssh -x -i ~/.ssh/special_id_dsa desk_pc /bin/cat '>>' /path/to/remote/file

Note the single quotes around the >>, necessary to prevent it redirecting locally.

You only need a pty for interactive programs, cat isn't.
 

9 More Discussions You Might Find Interesting

1. AIX

How to monitor pty

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)
Discussion started by: l-roner
2 Replies

2. Programming

good example for pty usage ?

i am looking for a good example to explain *why* someone should use pty's. (3 Replies)
Discussion started by: grumpf
3 Replies

3. Shell Programming and Scripting

monitoring SSH authorized_keys

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)
Discussion started by: prvnrk
0 Replies

4. UNIX for Advanced & Expert Users

monitoring SSH authorized_keys

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)
Discussion started by: prvnrk
1 Replies

5. UNIX for Dummies Questions & Answers

use of tty and pty files

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)
Discussion started by: saharookiedba
2 Replies

6. Programming

Race condition with PTY

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

Apparently my post is Homework/Classwork?

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)
Discussion started by: Waggie14
1 Replies

8. Shell Programming and Scripting

Appending authorized_keys on multiple servers using ssh

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)
Discussion started by: Grueben
0 Replies

9. Ubuntu

Help me to revert the file /root/.ssh/authorized_keys

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
dropbear(8)						      System Manager's Manual						       dropbear(8)

NAME
dropbear - lightweight SSH2 server SYNOPSIS
dropbear [-FEmwsgjki] [-b banner] [-d dsskey] [-r rsakey] [-p [address:]port] DESCRIPTION
dropbear is a SSH 2 server designed to be small enough to be used in small memory environments, while still being functional and secure enough for general use. OPTIONS
-b banner bannerfile. Display the contents of the file banner before user login (default: none). -d dsskey dsskeyfile. Use the contents of the file dsskey for the DSS host key (default: /etc/dropbear/dropbear_dss_host_key). Note that some SSH implementations use the term "DSA" rather than "DSS", they mean the same thing. This file is generated with dropbear- key(8). -r rsakey rsakeyfile. Use the contents of the file rsakey for the rsa host key (default: /etc/dropbear/dropbear_rsa_host_key). This file is generated with dropbearkey(8). -F Don't fork into background. -E Log to standard error rather than syslog. -m Don't display the message of the day on login. -w Disallow root logins. -s Disable password logins. -g Disable password logins for root. -j Disable local port forwarding. -k Disable remote port forwarding. -p [address:]port Listen on specified address and TCP port. If just a port is given listen on all addresses. up to 10 can be specified (default 22 if none specified). -i Service program mode. Use this option to run dropbear under TCP/IP servers like inetd, tcpsvd, or tcpserver. In program mode the -F option is implied, and -p options are ignored. -P pidfile Specify a pidfile to create when running as a daemon. If not specified, the default is /var/run/dropbear.pid -a Allow remote hosts to connect to forwarded ports. -W windowsize Specify the per-channel receive window buffer size. Increasing this may improve network performance at the expense of memory use. Use -h to see the default buffer size. -K timeout_seconds Ensure that traffic is transmitted at a certain interval in seconds. This is useful for working around firewalls or routers that drop connections after a certain period of inactivity. The trade-off is that a session may be closed if there is a temporary lapse of network connectivity. A setting if 0 disables keepalives. -I idle_timeout Disconnect the session if no traffic is transmitted or received for idle_timeout seconds. FILES
Authorized Keys ~/.ssh/authorized_keys can be set up to allow remote login with a RSA or DSS key. Each line is of the form [restrictions] ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIgAsp... [comment] and can be extracted from a Dropbear private host key with "dropbearkey -y". This is the same format as used by OpenSSH, though the restrictions are a subset (keys with unknown restrictions are ignored). Restrictions are comma separated, with double quotes around spaces in arguments. Available restrictions are: no-port-forwarding Don't allow port forwarding for this connection no-agent-forwarding Don't allow agent forwarding for this connection no-X11-forwarding Don't allow X11 forwarding for this connection no-pty Disable PTY allocation. Note that a user can still obtain most of the same functionality with other means even if no-pty is set. command="forced_command" Disregard the command provided by the user and always run forced_command. The authorized_keys file and its containing ~/.ssh directory must only be writable by the user, otherwise Dropbear will not allow a login using public key authentication. Host Key Files Host key files are read at startup from a standard location, by default /etc/dropbear/dropbear_dss_host_key and /etc/dropbear/drop- bear_rsa_host_key or specified on the commandline with -d or -r. These are of the form generated by dropbearkey. Message Of The Day By default the file /etc/motd will be printed for any login shell (unless disabled at compile-time). This can also be disabled per- user by creating a file ~/.hushlogin . ENVIRONMENT VARIABLES
Dropbear sets the standard variables USER, LOGNAME, HOME, SHELL, PATH, and TERM. The variables below are set for sessions as appropriate. SSH_TTY This is set to the allocated TTY if a PTY was used. SSH_CONNECTION Contains "<remote_ip> <remote_port> <local_ip> <local_port>". DISPLAY Set X11 forwarding is used. SSH_ORIGINAL_COMMAND If a 'command=' authorized_keys option was used, the original command is specified in this variable. If a shell was requested this is set to an empty value. SSH_AUTH_SOCK Set to a forwarded ssh-agent connection. AUTHOR
Matt Johnston (matt@ucc.asn.au). Gerrit Pape (pape@smarden.org) wrote this manual page. SEE ALSO
dropbearkey(8), dbclient(1) http://matt.ucc.asn.au/dropbear/dropbear.html dropbear(8)
All times are GMT -4. The time now is 03:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy