Connecting To Different Unix Box


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Connecting To Different Unix Box
# 1  
Old 10-17-2006
Connecting To Different Unix Box

Hi gurus

I want to to connect to a different unix box from current unix box and navigate to a folder and check if the log files are generated for every 10 minutes in the another unix box. how do i go about this requirement. is there a way to connect to different unix boxes.

thanks
raghavendra
# 2  
Old 10-17-2006
to connect to a different unix box, you may use SSH ot telnet, provided that SSH or telnet (whatever you select) is working at that unix box. you may even use ftp or sftp.
# 3  
Old 10-17-2006
i use putty and it resides in a different box. actually a windows workstation! i need to write a shell script and put it in a particular box and i should be able to navigate to other boxes from the box in which my shell script resides and i should be able to execute the script from my windows workstation. is it possible??

thanks
ragha
# 4  
Old 10-17-2006
Quote:
Originally Posted by ragha81
I use putty, and it resides in a different box. Actually, a windows workstation!
PUTTY is ssh.
Quote:
I need to write a shell script and put it in a particular box, and I should be able to navigate to other boxes from the box in which my shell script resides, and I should be able to execute the script from my windows workstation. is it possible?
ssh, by it's very nature, is quite a bear to automate.

Running the script automatically, that isn't a problem, create a new account with the correct permissions and have .bashrc or whatever run the script. Letting it login to other machines automatically is harder. Look for "shared keys" and ssh.
# 5  
Old 10-17-2006
with ssh you may execute a command on a remote unix box and get its output without opening a session there, for example

ssh target_account@remote_host /usr/bin/ls some_dir/logfile

To automate the process you can use the crontab command but you will need some more steps to get ssh work in unattended mode, that is, without asking for password when the ssh command is invoked. The steps are:
1) the caller account must generate a pair of keys with ssh_keygen. Output files id_rsa and id_rsa.pub will be generated in the ${HOME}/.ssh directory. The first is your private key and the other one is your public key.
2) transfer your public key (id_rsa.pub) to the target account on the remote machine by scp or ftp or any other available method.
3) on the target account append your transferred public key (id_rsa.pub) to the file authorized_keys:
cat id_rsa.pub >> ${HOME}/.ssh/authorized_keys

Repeat steps 2 and 3 for any host you need to monitor.

Create a shell script, say ${HOME}/check.sh, with a line like below for any host you need to monitor:
/usr/bin/ssh target_account@remote_host /usr/bin/ls some_dir/logfile

Use the "crontab -e" command in the caller account to insert a line that will be executed every 10 minute:
00,10,20,30,40,50 * * * * ksh ${HOME}/check.sh >>${HOME}/check.log 2>&1

You may improve this idea to serve better your goals.

Hope this helps.
# 6  
Old 10-17-2006
thanks a lot for your reply. i will try this out and let you know. thanks again
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Transferring the file from one UNIX box to another UNIX box

Hi Folks, I am using winscp to graphiclly move the files from one unix box to another unix box , let say one unix box crediantials is (These are dummy crediantials) xxx -->username yyy -->password and another unix box name is RRR -->username TTT -->password NOW i need to... (4 Replies)
Discussion started by: punpun66
4 Replies

2. UNIX for Advanced & Expert Users

Help connecting linux box to Windows - winbindd problem

Hi experts - I hope you can help me. I am trying to resolve Windows host names (aka Netbios names, aka "UNC names) from a Linux box. I have added "dns wins" to the "hosts" line at /etc/nsswitch.conf, and installed samba 3.2.2 and ran "winbindd -D". Now, when I go: "wbinfo -N venus" (where... (1 Reply)
Discussion started by: maryg
1 Replies

3. Shell Programming and Scripting

ftp file starting with particular name on Windows box to Unix box using shell script

Hello all ! I'm trying to write a shell script (bash) to ftp a file starting with particular name like "Latest_" that is present on a Windows box to UNIX server. Basically I want to set this script in the cron so that daily the new build that is posted on the Windows box can be downloaded to the... (2 Replies)
Discussion started by: vijayb4u83
2 Replies

4. Shell Programming and Scripting

how to compare all files in one unix box has been to copied to another unix box

Hi our unix admin has copied all files from one unix box to new unix box. We just need to confirm that all the file systems are copied properly. How to validate. (9 Replies)
Discussion started by: sravanreddym
9 Replies

5. UNIX for Dummies Questions & Answers

I need an scp command from a unix box to a windows box.

scp file="myfile.txt" todir="user@somehost:(M:drive:/somepath/)"/ Not sure I need it to go to a specific drive on the windows box (1 Reply)
Discussion started by: xgringo
1 Replies

6. Shell Programming and Scripting

Moving files from Unix box to a windows box

Hi All, I need a little help .I want to transfer a file from unix box to a windows box,but the problem i'm facing is that in windows box FTP is not enabled and currently it is nearly impssible to change setting on windows box,i can not use the ftp method ,in my shell script to transfer the file.... (2 Replies)
Discussion started by: Preet
2 Replies

7. UNIX for Dummies Questions & Answers

Running UNIX commands remotely in Windows box from Unix box – avoid entering password

I am able to run the UNIX commands in a Windows box from a UNIX box through "SSH" functionality. But whenever the SSH connection is established between UNIX and Windows, password for windows box is being asked. Is there a way to avoid asking password whenever the SSH connection is made? Can I... (1 Reply)
Discussion started by: D.kalpana
1 Replies

8. Shell Programming and Scripting

connecting to another unix box

Hi gurus, I am entirely new to unix. So if my questions are foolish, please bear with me. I have two unix boxes A and B. Is it possible to execute a command or a shell script in box B standing in box A. I mean if i log in to box A and execute a shell script, it should be able to login... (7 Replies)
Discussion started by: bade_miya
7 Replies

9. UNIX for Advanced & Expert Users

How to FTP a file generated at UNIX Box to NT Box

Hi all, I am generating a file on the Unix machine , now i want to FTP the same file to the NT machine. how can i do that and the application currently upon which i am working is a JAVA based application. I need your help. regards Ruchir (2 Replies)
Discussion started by: Ruchir
2 Replies

10. UNIX for Advanced & Expert Users

VPN client (windows Box),and Server (Unix Box)

If I want to access unix box via VPN tunnel,from windows box. What sould I configure on the windows client PC, and what should I enable on the Unix Server box ? I am using Solaris V10 intel platform, and I am using windows XP, and 2003 for client (0 Replies)
Discussion started by: zillah
0 Replies
Login or Register to Ask a Question