Putty session freezes when sudo


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Putty session freezes when sudo
# 1  
Old 01-29-2014
Putty session freezes when sudo

I have a Windows batch file with the below entry for auto login.
Code:
putty.exe -ssh user1@10.10.10.7 -pw passwd1 -m command.txt

commnd.txt contains the below entries
Code:
pwd
sudo su - user2

Switching from user1 to user2 does not require any password [auto switch].

Output just prints the pwd and not sudo

When i do this manually it works, but when i tried to automate as above the putty session sort of freezes.

OS: SunOS Sprac IP: 10.10.10.7

Any clues / Alternate workarounds ?
# 2  
Old 01-29-2014
whether your client machine using public ip ? if so then it hangs sometimes... it must be doing reverse dns lookup I guess..

check dig -x clientip

Last edited by Akshay Hegde; 01-29-2014 at 02:12 PM.. Reason: i missed in dig
# 3  
Old 01-29-2014
If you're trying to automate it, plink may be more reliable than putty. (Derived from the same program, available from the same source.)
# 4  
Old 01-29-2014
plink also freezes the same way as putty.

dg command not found !!
# 5  
Old 01-29-2014
man su:
Code:
           When - is used, it must be specified as the last su option. The other forms (-l and --login) do not have this restriction.

# 6  
Old 01-30-2014
Quote:
Originally Posted by RudiC
man su:
Code:
           When - is used, it must be specified as the last su option. The other forms (-l and --login) do not have this restriction.


I did not get much of what you said ... but what i could understand is that I should try sudo su user2 instead of sudo su - user2

I tried, but that too did not help !! Any suggestions ?
# 7  
Old 02-05-2014
Can you see the output of pwd? Or just the words "pwd"? Your shell might not be starting correctly causing a hang in the session. Try executing the command without the su part and confirm you are able to login. If anything add a sleep, it may need sometime to log in and load the shell.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Restarting a putty session

Hi, Is there any way to refresh the session(for the profile file changes get reflect) in putty? I am tired of closing reopening putty. Thanks, Pandeeesh CTRL + Q to Enable/Disable GoPhoto.it (4 Replies)
Discussion started by: pandeesh
4 Replies

2. Solaris

M5000 XSCF Console disconnecting when putty session is closed

Hi, I would appreciate some help. I remotely access, across a VPN, an M5000 and when I connect to the XSCF I can then access the OS using console -d0 and then I can get to the console. The problem I have is that I need to run something which will take many hours and I can't run it in the... (6 Replies)
Discussion started by: giles.cardew
6 Replies

3. Emergency UNIX and Linux Support

Nohup process getting killed after closing PUTTY session

I am running a process in nohup . nohup getkeys.ksh 132 > 132.out & When I close the putty terminal,The process is getting killed . default_signal_handler called for signal no: 1 Is there a way to keep the process running even If I close the terminal (2 Replies)
Discussion started by: prasperl
2 Replies

4. UNIX for Dummies Questions & Answers

connecting to an ssh session with putty/bash.

Hi, sorry if this is the wrong forum for this question but I couldnt spot another obvious forum for it. I have a windows shortcut which opens up a saved session in putty. From this session I then ssh to another remote server. I was wondering is there a way that I can either edit my shortcut... (2 Replies)
Discussion started by: newb1000
2 Replies

5. UNIX for Dummies Questions & Answers

Putty Session Timeout

Hi, I had add the following line into .profile and .bash_profile for the timeout session to avoid putty close automatically : timeout=10800 However, i still keep encounter session time out every after 60 seconds. Can anyone please help advice. Many Thanks! (2 Replies)
Discussion started by: wancy
2 Replies

6. Red Hat

Save sudo privilege for session

I have setup public key based login to my CentOS VPS. I wish to disable direct root login and have created an admin user under wheel group and have modified /etc/sudoers file and gave Wheel group all privileges. But now I am being prompted for password whenever I type sudo. I do not wish to... (4 Replies)
Discussion started by: JoyceBabu
4 Replies

7. AIX

Enabling color for putty session

Hi Everyone: Is there any way to enable colors through putty for a session into AIX? I've tried to set the TERM variable to xterm-256color but it doesn't work having a 8-color terminal would be okay for me thanks in advance (5 Replies)
Discussion started by: edgarvm
5 Replies

8. Solaris

I am not able to login in gnome session and java session in Sun solaris 9& 10

I am not able to login in gnome session and java session in Sun solaris 9& 10 respectively through xmanager as a nis user, I am able to login in common desktop , but gnome session its not allowing , when I have given login credentials, its coming back to login screen, what shoul I do to allow nis... (0 Replies)
Discussion started by: durgaprasadr13
0 Replies

9. UNIX for Advanced & Expert Users

Putty session

Dear all, We have a practice of getting user's passwords expired after 60 days and a strong password policy. When a user tries to enter a password which is not compliant to the policy which is set putty exists without giving any feedback to the user. Below is something i captured from the... (3 Replies)
Discussion started by: earlysame55
3 Replies
Login or Register to Ask a Question