View file on distant machine


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users View file on distant machine
# 1  
Old 11-14-2005
Data View file on distant machine

Hello everybody,

I have a program that connects to a distant machine using a specific port. Then inetd executes a command on that distant machine (M2).

What I'd like to do is write a scipt that, given the port, it gives me the command executed. (The script should be launched on the local machine M1 and should look into the /etc/inetd.conf on the machine M2).

I have a username and password on the machine M2, so when I connect using rlogin, I can view the /etc/inetd.conf without any problem.

I tryed to do an FTP on my script (machine M1), but it's not possible (permission denied).

I tryed `rsh -l login cat /etc/inetd.conf`, no way.. (I can add my user to the .rhosts, but I want a script that could be launched from anywhere).

I tryed :
rlogin M2 -l user << STOP > file.tmp
password
cat /etc/inetd.conf
STOP

But the script showes the message "Closed connection." and the "file.tmp" is empty.

Any idea ?
Thanks in advance Smilie
# 2  
Old 11-14-2005
You cannot use rlogin to do this. The first lines in the man page of rlogin have this to say:
" rlogin establishes a remote login session from your terminal to the remote machine named hostname."

You could use rsh to do this, as you have already tried. I see no reason why that should fail.
# 3  
Old 11-14-2005
Because with rsh, if the remote host doesn't have your login in its .rhosts file you won't be able to do anything. It doesn't prompt you for a password or anything..
# 4  
Old 11-15-2005
If the server has ssh setup, you can use ssh...
# 5  
Old 11-15-2005
and what's the difference ?
# 6  
Old 11-15-2005
Command line ssh allows you to run a command remotely and ask you for a password if you do not have direct (password less) access. And that (direct access) is also pretty easy to setup.

Check the man pages for details on ssh.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. What is on Your Mind?

Moving from Desktop View to Mobile View

See attached video for a demo on how to move back and forth from the desktop view to the mobile view. Currently this only works for the home page, but I will work on some new PHP code in the future to make this work with the page we are currently on. Edit: The issue with making every page ... (2 Replies)
Discussion started by: Neo
2 Replies

2. UNIX for Dummies Questions & Answers

Matching position and output neighbors within 500 distant

Hi, I have been struggling to match positions output its neigbors. Can you please help ? I have 2 files.They both have the same format (same number of columns) but first file is a kind of subset of second file The first file looks like this (tab delimited): 1 11567687 snpid20 1 153881... (4 Replies)
Discussion started by: fat
4 Replies

3. UNIX for Dummies Questions & Answers

Run perl scripts to a distant server!!!!

Hello everybody; I want to run some scripts perl on my windows pc to a distant server linux which i connect to it via putty,I'm just a small beginner and I want just to know if this is possible or not and if you can send me some docs I will really grateful. (1 Reply)
Discussion started by: bassma
1 Replies

4. UNIX for Dummies Questions & Answers

Process on distant server

Hello, I have a question regarding how to manage a process on a distant unix server. I perform calculations on a dedicated Unix server (RedHat ELS5.5) using Matlab (installed on the server). The commands are written in a terminal session (via ssh) on my laptop (MacBook Pro6,2 - MacOS X 10.6.7).... (1 Reply)
Discussion started by: antonino_ch
1 Replies

5. UNIX for Dummies Questions & Answers

not able to view the file

Hi All, I am experiencing a strange and serious issue. I can see, a file exist there inside a directory while doing cat i can see the file exists, but while trying to view that its saying NO such File or Directory. (ipbala01)/env/balast7/app/working/batch_loader/data/system_2/input>ll total 12... (8 Replies)
Discussion started by: gotam
8 Replies

6. Solaris

How do I view file?

I am trying to view the files in /etc/security/audit/SERVERNAME/files, but when I gunzip them and then do a cat I get a bunch of garbage with some stuff that makes sense. I need to view this file without having all the garbage. I tried to cat it and vi it without any luck. Can someone show me an... (4 Replies)
Discussion started by: jastanle84
4 Replies

7. Red Hat

To find the LATEST file from a dir on REMOTE machine and SCP to local machine?

Hi All, URGENT - Please help me form a scipt for this: I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server) I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Discussion started by: me_ub
3 Replies

8. UNIX for Advanced & Expert Users

view remote linux desktop on my windows machine

Hi, is there anyway i can view a remote linux desktop on my windows desktop? i am aware that X11 can see 'certain screens'. For eg if i type 'xclock &' and i have a client running on my windows, i can see the clock. If i am interested to see the entire desktop of my linux, how can i do it? (4 Replies)
Discussion started by: new2ss
4 Replies

9. UNIX for Advanced & Expert Users

How do I view my hardware specs in my unix machine ?

I am trying to view the hardware specifications through ssh (4 Replies)
Discussion started by: kfir
4 Replies
Login or Register to Ask a Question