stty: tcgetattr: A specified file does not support the ioctl system call.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users stty: tcgetattr: A specified file does not support the ioctl system call.
# 1  
Old 05-28-2007
Network stty: tcgetattr: A specified file does not support the ioctl system call.

Hi,

I am trying to implement SSH between two systems say ukblx151 & ukapx047 with ID say khzs228, i follow the following process:

Step-1) $ ssh-keygen -t rsa -f rsa
Generating public/private rsa key pair.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in rsa.
Your public key has been saved in rsa.pub.
The key fingerprint is:
5c:cb:fb:ec:87:a2:0e:92:a4:bd:e7:8f:99:1b:5c:50 khzs228@ukblx151

Step-2) $ cat rsa.pub | ssh khzs228@ukapx047 `cat - >> /home/khzs228/.ssh/authorized_keys`
Pseudo-terminal will not be allocated because stdin is not a terminal.
khzs228@ukapx047's password:
stty: tcgetattr: A specified file does not support the ioctl system call.


I get the above error (i.e. stty:tcgetattr: A specified file does not support the ioctl system call.), can anybody help?

Regards,
Vishal
# 2  
Old 05-28-2007
Quote:
Originally Posted by vishal_ranjan
Pseudo-terminal will not be allocated because stdin is not a terminal.
may be related to

Quote:
Originally Posted by vishal_ranjan
stty: tcgetattr: A specified file does not support the ioctl system call.

The "cat ssh.pub | ssh" part means that ssh got a pipe as stdin which is not a terminal. Hence it did not allocate a pseudo-terminal, as it's not a terminal tcgetattr() is not going to work.
# 3  
Old 05-29-2007
Quote:
Originally Posted by porter
may be related to




The "cat ssh.pub | ssh" part means that ssh got a pipe as stdin which is not a terminal. Hence it did not allocate a pseudo-terminal, as it's not a terminal tcgetattr() is not going to work.
Porter,
Can you explain a bit in detail?
# 4  
Old 05-29-2007
A normal process has three default file descriptors, these are stdin, stdout and stderr and normally attached to a terminal.

IO redirection replaces some of these connections with pipes.

A file descriptor attached to a terminal will respond to tcgetattr, one attached to a pipe will not.

Your "cat ssh.pub | ...." replaced stdin with a pipe......
# 5  
Old 05-29-2007
thanks a lot Porter
# 6  
Old 05-29-2007
Hi Porter/All,

I just tried one thing, i used "'" instead of "`" in cat rsa.pub | ssh khzs228@ukapx047 `cat - >> /home/khzs228/.ssh/authorized_keys` command & i am very happy to tell you that it worked & the problem of stty: tcgetattr didnt appear, but issue here is when i give a command like "ssh user@destination-server.com" it again asks for user's password, & this i dont want, it shouldnt ask for password. Any ideas?

Regards,
Vishal
# 7  
Old 05-29-2007
1. Each user needs to generate a public and private key. This key should *not* require a password.

2. Each user needs to add they public key to their $HOME/.ssh/authorized_keys

3. Each user needs to provide the key on the ssh command line

If you already have an .ssh/id and .ssh/id.pub use the id.pub and ssh should pick up .ssh/id by default.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Tcgetattr: Inappropriate ioctl for device

Hi, ssh -q -t -l $usr $host bin/test.sh I am using above command to run script remotely. script is working without any issues. but I am getting "tcgetattr: Inappropriate ioctl for device" message on console. plz help how can I avoid this message. Thanks Moved thread from Emergency... (1 Reply)
Discussion started by: Kri
1 Replies

2. Shell Programming and Scripting

tcgetattr: Inappropriate ioctl for device after ssh command

Hello everyone I am finishing a script allowing me to purge logs on multiple servers, i have one last pb with the ssh command.........it is throwing me the following error : tcgetattr: Inappropriate ioctl for device (full screen in attached file 1, full script in attached file 2) It... (15 Replies)
Discussion started by: jimmy75_13
15 Replies

3. Shell Programming and Scripting

stty: tcgetattr: A specified file does not support the ioctl system call

Hi Gurus, I have scheduled a script using cron scheduler. Script works fine when i run it manually. But it gives the following error in cron log. stty: tcgetattr: A specified file does not support the ioctl system call. I have given the following statement in cron. 0-59 * * * *... (5 Replies)
Discussion started by: svajhala
5 Replies

4. Programming

how to call dot c file using system command

Hi every one, i have to dot pc files. One have main function but one dont have.I have to call dot pc file using system () cmd.File is being call have main function.Please let me know how i can call .pc file with two arguments from other dot pc file.I want some thing like sprintf(buf, "ss_xxx.pc... (4 Replies)
Discussion started by: goraya430
4 Replies

5. Shell Programming and Scripting

how to call dot c file using system command

Hi every one, i have to dot pc files. One have main function but one dont have.I have to call dot pc file using system () cmd.File is being call have main function.Please let me know how i can call .pc file with two arguments from other dot pc file.I want some thing like sprintf(buf,... (1 Reply)
Discussion started by: goraya430
1 Replies

6. SCO

stty: tcgetattr failed

I was using i/o8+ serial (with baud 9600,4800 & 1200)without any problem after uninstalling the above card I installed ultraport8i serial card of the same Oem I am getting the error message stty: tcgetattr failed: inappropriate I/O control operation (error 25) please help::confused: (0 Replies)
Discussion started by: aak
0 Replies

7. UNIX for Advanced & Expert Users

ioctl() system call on Linux-i386

Greetings, Please help me with the following : Where can I find what means exactly and how to use each of the second argument of the ioctl() system call in Linux/386 : FIOxxx (file IOCTL requests), SIOxxx (socket IOCTL requests), TCxxx TIOxxx (terminal IOCTL requests) ? ... (1 Reply)
Discussion started by: aigoia
1 Replies

8. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

9. UNIX for Dummies Questions & Answers

stty tcgetattr errors

Hi, I have an app that runs Oracle 8.1.7 residing on a AIX 4.3 ML 10 . preiodically app sends out a status log like the one displayed below. Lately I have noticed this stty:tcgetattr message in the log. Script that writes this output calls sqlplus, gets the required count and writes output to... (8 Replies)
Discussion started by: Student37
8 Replies
Login or Register to Ask a Question