Need help in ssh (URGENT)


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Need help in ssh (URGENT)
# 1  
Old 07-16-2015
Code Need help in ssh (URGENT)

Hi guys,

I'm new to unix. I'm creating a small script which should fetch the server space details from different servers and it as a mail.

Right now my script is working perfectly. But i have a problem in deploying it.

I'm using the command ssh user@host 'df -h /app/directory'

We are using a server which requires sudo su. If i do sudo, my script is not working.
My TECTIA is using my Smartcard credentials initially.

These are the Options i have but not sure how to proceed here.Smilie
Option 1: I should be able to run the script using the sudo account id.
Option 2: My script should do "exit" from sudo account and run. (which is not recommended)

Please help me on this. Smilie

Thanks,
Santhosh
# 2  
Old 07-16-2015
Everyone at the UNIX and Linux Forums gives their best effort to reply to all questions in a timely manner. For this reason, posting questions with subjects like "Urgent!" or "Emergency" and demanding a fast reply are not permitted in the regular forums.

For members who want a higher visibility to their questions, we suggest you post in the Emergency UNIX and Linux Support Forum. This forum is given a higher priority than our regular forums.

Posting a new question in the Emergency UNIX and Linux Support Forum requires forum Bits. We monitor this forum to help people with emergencies, but we do not not guarantee response time or best answers. However, we will treat your post with a higher priority and give our best efforts to help you.

If you have posted a question in the regular forum with a subject "Urgent" "Emergency" or similar idea, we will, more-than-likely, close your thread and post this reply, redirecting you to the proper forum.

Of course, you can always post a descriptive subject text, remove words like "Urgent" etc. (from your subject and post) and post in the regular forums at any time.


Thank you.

The UNIX and Linux Forums
These 4 Users Gave Thanks to Don Cragun For This Post:
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Find active SSH servers w/ ssh keys on LAN

Hi, I am trying to complete my bash script in order to find which SSH servers on LAN are still active with the ssh keys, but i am frozen at this step: #!/bin/bash # LAN SSH KEYS DISCOVERY SCRIPT </etc/passwd \ grep /bin/bash | cut -d: -f6 | sudo xargs -i -- sh -c ' && cat... (11 Replies)
Discussion started by: syrius
11 Replies

2. UNIX for Beginners Questions & Answers

Ssh script to validate ssh connection to multiple serves with status

Hi, I want to validate ssh connection one after one for multiple servers..... password less keys already setup but now i want to validate if ssh is working fine or not... I have .sh script like below and i have servers.txt contains all the list of servers #/bin/bash for host in $(cat... (3 Replies)
Discussion started by: sreeram4
3 Replies

3. Shell Programming and Scripting

URGENT Reading a file and assessing the syntax shell script URGENT

I am trying to write a shell script which takes an input file as an arguement in the terminal e.g. bash shellscriptname.sh input.txt. I would like for the file to be read line by line each time checking if the .txt file contains certain words or letters(validating the syntax). If the line being... (1 Reply)
Discussion started by: Gurdza32
1 Replies

4. Shell Programming and Scripting

Ssh = ssh expect and keep everything not change include parameter postion

I have write a script which contains ssh -p 12345 dcplatform@10.125.42.50 ssh 127.0.0.1 -p 5555 "$CMD" ssh root@$GUEST_IP "$CMD" before I use public key, it works well, now I want to change to "expect", BUT I don't want to change above code and "parameter position" I can post a... (1 Reply)
Discussion started by: yanglei_fage
1 Replies

5. UNIX for Advanced & Expert Users

Urgent ssh -1 not working

Hi guys please help with the following. $ ssh -1 -v -l username -o "ForwardX11 yes" server.name netscape OpenSSH_5.8p1, OpenSSL 0.9.8r 8 Feb 2011 debug1: Connecting to proxy-bt-2 port 22. debug1: Connection established. debug1: identity file /home/username/.ssh/identity type -1 debug1:... (1 Reply)
Discussion started by: llcooljatt
1 Replies

6. Shell Programming and Scripting

could not send commands SSH session with Net::SSH::Expect

I am using Net::SSH::Expect to connect to the device(iLO) with SSH. After the $ssh->login() I'm able to view the prompt, but not able to send any coommands. With the putty I can connect to the device and execute the commands without any issues. Here is the sample script my $ssh =... (0 Replies)
Discussion started by: hansini
0 Replies

7. Solaris

[urgent need help] SSH setup...

hi experts, very need help, i had setup the SSH on solaris 8 and have generate the key but i have problem to start the sshd below is the error messages : /etc/rc2.d/S97sshd start Could not load host key: /usr/local/etc/ssh_host_key Could not load host key: /usr/local/etc/ssh_host_rsa_key... (6 Replies)
Discussion started by: bucci
6 Replies

8. UNIX for Advanced & Expert Users

URGENT,URGENT- Need help tape drive installation

Hi, I am trying to attach tape drive to sun V890 running Solaris 9 on it. I have installed HBA(qlogic) in slot 1 of 0-8 slots and booted the system. I do not see HBAin prtdiag output. The tape drive is not attached to HBA. The tape drive I am going to attach is Sony AIT3. 1.How can I make... (3 Replies)
Discussion started by: sriny
3 Replies
Login or Register to Ask a Question