Sponsored Content
Top Forums Shell Programming and Scripting changing shell while using ssh Post 302285573 by amit1_x on Monday 9th of February 2009 08:51:13 AM
Old 02-09-2009
changing shell while using ssh

Hello,

I am trying to ssh to a remote machine then change the shell and execute the script. However the ssh session hangs when i try to change the shell

Code:
ssh user@host 'csh ; source /home/cshProfile; $HOME/exec.sh'

if i do

Code:
ssh user@host  ' $HOME/exec.sh'

This works however i get errors as some of the env variables are in cshProfile file which is for cshell and the default shell of the remote user is ksh. so i have to first changet to csh on the remote machine, source the profile and execute the script.

Any advices?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to run cmds after changing to a new env (shell) in a shell script

Hi, I am using HP-UNIX. I have a requirement as below I have to change env twice like: cadenv <env> cadenv <env> ccm start -d /dbpath ccm tar -xvf *.tar ccm rcv .... mv *.tar BACKUP but after I do the first cadenv <env> , I am unable to execute any of the later commands . ... (6 Replies)
Discussion started by: charlei
6 Replies

2. Shell Programming and Scripting

Regarding changing shell thru script

Guys can I change the shell thru script, and after changing i want the script to continue on the previous machine. Or please suggest other alternative if any??? #!/bin/ksh HOST=`hostname` echo "Running the script..." for MyServer in `cat ServerNames.txt` do echo "\n Logging onto... (4 Replies)
Discussion started by: sdosanjh
4 Replies

3. Shell Programming and Scripting

Changing the shell prompt

Hi, I want to change the shell prompt, using the cd command. I have a shell prompt like this - p78-mfx(dgaw1078/9781)$ Now i do this - p78-mfx(dgaw1078/9781)$ cd log4j here the shell prompt should change like this - p78-mfx(dgaw1078/9781)log4j$ (6 Replies)
Discussion started by: arunkumarmc
6 Replies

4. UNIX for Dummies Questions & Answers

changing shell???

hi guys I have a user that has been used for long time now that runs o C Shell... now there is a need to change it to Bash Shell? Can I cause a problem changing his shell from C to bash? I mean apps or variables? thanks a lot (3 Replies)
Discussion started by: karlochacon
3 Replies

5. AIX

Users kicked out after changing their password in an ssh session

Hi I have experienced this for years and just put up with it. However a client of mine now wants to stop this happening to their users. I have scoured the internet but can find no reference to the problem. I tried switching to PAM authentication thinking this might help but it made no... (6 Replies)
Discussion started by: johnf
6 Replies

6. Shell Programming and Scripting

Changing from one shell to another

Hi all,I installed cent OS in my machine. Now when i open the terminal and start writing some commands, then by default with which shell i am working with? Will i be able to change the shell and then run a few commands? if possible then how to change the shell? Please reply Thank you (8 Replies)
Discussion started by: gautamshaw
8 Replies

7. Shell Programming and Scripting

changing a shell

i have created users but those are not listing in HOME directory...and i want to change a shell to another shell...can any one reply me with solutions.. (4 Replies)
Discussion started by: potu@123
4 Replies

8. Solaris

SSH : Restarting too quickly, changing state to maintenance

Hi, I'm new to Solaris. I have an issue with ssh service. When I restart the service it exits with an exit status of 0 $svcadm restart svc:/network/ssh:default $echo $? 0 $ However, the service goes into maintenance mode after restart. I'm able to connect even though the service is in... (3 Replies)
Discussion started by: maverick_here
3 Replies

9. Shell Programming and Scripting

Changing shell from a script and running something from the new shell

Hi We use "tcsh" shell . We do the following steps manually: > exec ssh-agent zsh > python "heloo.py" (in the zsh shell) I am trying to do the steps above from a shell script This is what I have so far echo "Executing " exec ssh-agent zsh python "hello.py" exit 0 Problem is... (5 Replies)
Discussion started by: heman82
5 Replies

10. Shell Programming and Scripting

Changing value using 1 shell command

Hello all, I would like to know how to change a value in my file.txt with 1 command. Using sed seems impossible since it contains \n and \s... For example: player: version: V6R2013xD3HF5v1 partchecker: version: 6.142.1-rc6 player_old: version: V6R2013xD3HF5v1 ... (6 Replies)
Discussion started by: jcanale
6 Replies
SSH-KEYSIGN(8)						    BSD System Manager's Manual 					    SSH-KEYSIGN(8)

NAME
ssh-keysign -- ssh helper program for host-based authentication SYNOPSIS
ssh-keysign DESCRIPTION
ssh-keysign is used by ssh(1) to access the local host keys and generate the digital signature required during host-based authentication. ssh-keysign is disabled by default and can only be enabled in the global client configuration file /etc/ssh/ssh_config by setting EnableSSHKeysign to ``yes''. ssh-keysign is not intended to be invoked by the user, but from ssh(1). See ssh(1) and sshd(8) for more information about host-based authen- tication. FILES
/etc/ssh/ssh_config Controls whether ssh-keysign is enabled. /etc/ssh/ssh_host_dsa_key /etc/ssh/ssh_host_ecdsa_key /etc/ssh/ssh_host_ed25519_key /etc/ssh/ssh_host_rsa_key These files contain the private parts of the host keys used to generate the digital signature. They should be owned by root, read- able only by root, and not accessible to others. Since they are readable only by root, ssh-keysign must be set-uid root if host- based authentication is used. /etc/ssh/ssh_host_dsa_key-cert.pub /etc/ssh/ssh_host_ecdsa_key-cert.pub /etc/ssh/ssh_host_ed25519_key-cert.pub /etc/ssh/ssh_host_rsa_key-cert.pub If these files exist they are assumed to contain public certificate information corresponding with the private keys above. SEE ALSO
ssh(1), ssh-keygen(1), ssh_config(5), sshd(8) HISTORY
ssh-keysign first appeared in OpenBSD 3.2. AUTHORS
Markus Friedl <markus@openbsd.org> BSD
February 17, 2016 BSD
All times are GMT -4. The time now is 01:45 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy