View previous topic :: View next topic |
Author |
Message |
alex.blackbit Advocate

Joined: 26 Jul 2005 Posts: 2397
|
Posted: Sat Mar 29, 2008 8:57 pm Post subject: ssh connection with non-standard shell |
|
|
hi,
can i open a (open)ssh connection and execute a shell on the remote computer?
i tried withbut that does not work. i want to do that on a host that
* is badly configured so that i cannot change my standard shell
* is not administrated by me
* has the shell i want
and i do not like to enter the same command every time i connect if there is a better way.
putty has such feature, so there must be a way. it would be best if there is a option for ssh_config, because the need for this is permanent.
the manpages ssh(1) and ssh_config(5) did not help me. |
|
Back to top |
|
 |
desultory Bodhisattva


Joined: 04 Nov 2005 Posts: 9410
|
Posted: Sun Mar 30, 2008 9:31 am Post subject: |
|
|
alex.blackbit wrote: | but that does not work. | Please elaborate.
alex.blackbit wrote: | and i do not like to enter the same command every time i connect if there is a better way. | Have you considered using shell scripts? |
|
Back to top |
|
 |
bunder Bodhisattva

Joined: 10 Apr 2004 Posts: 5956
|
Posted: Sun Mar 30, 2008 9:45 am Post subject: |
|
|
can you run "chsh"? that should change your default shell... you wanted zsh, so you would enter "/bin/zsh".
cheers _________________
Neddyseagoon wrote: | The problem with leaving is that you can only do it once and it reduces your influence. |
banned from #gentoo since sept 2017 |
|
Back to top |
|
 |
alex.blackbit Advocate

Joined: 26 Jul 2005 Posts: 2397
|
Posted: Sun Mar 30, 2008 11:05 pm Post subject: |
|
|
@bunder: as i wrote in my initial post, the system is not configured correctly, so chsh does not work. that's why i am searching for such a hack.
@desultory: yes, you are right, it is a possibility to start my shell from .bashrc (bash is the default shell on that system), but that's not exactly what i want to do.
is there really no way to start a non-standard shell on a ssh connection?!?! i cannot believe it. |
|
Back to top |
|
 |
desultory Bodhisattva


Joined: 04 Nov 2005 Posts: 9410
|
Posted: Sun Mar 30, 2008 11:38 pm Post subject: |
|
|
desultory wrote: | alex.blackbit wrote: | but that does not work. | Please elaborate. | In what way does it fail?
alex.blackbit wrote: | @desultory: yes, you are right, it is a possibility to start my shell from .bashrc (bash is the default shell on that system), but that's not exactly what i want to do. | I was referring to using scripts on the client side, not the server side. |
|
Back to top |
|
 |
alex.blackbit Advocate

Joined: 26 Jul 2005 Posts: 2397
|
Posted: Sun Mar 30, 2008 11:41 pm Post subject: |
|
|
with "fail" i meant that just nothing happens. no error messages, no prompt. nothing. when i hit ctrl+c i get "Killed by signal 2", that's all.
how would such a clientside script look like? |
|
Back to top |
|
 |
desultory Bodhisattva


Joined: 04 Nov 2005 Posts: 9410
|
Posted: Mon Mar 31, 2008 2:09 am Post subject: |
|
|
alex.blackbit wrote: | with "fail" i meant that just nothing happens. no error messages, no prompt. nothing. when i hit ctrl+c i get "Killed by signal 2", that's all. | It is working, though no virtual terminal is being allocated, this can be verified by running commands in the shell. To rectify the problem the -t option can be used to force a virtual terminal to be allocated.
alex.blackbit wrote: | how would such a clientside script look like? |
Code: | #!/bin/sh
exec ssh -t host zsh |
|
|
Back to top |
|
 |
alex.blackbit Advocate

Joined: 26 Jul 2005 Posts: 2397
|
Posted: Mon Mar 31, 2008 1:40 pm Post subject: |
|
|
thank you very much, desultory, you were totally right.
i didn't even try to enter anything in this situation, because i didn't thought this could work, but actually entering "ls" gave back the right results... that's a list with "\n"s, because ls things that the output is not a normal terminal
and the "-t" option does what i want, the script you provided is not necessary. a simple
gives me my shell.
the last question is: is there a way to set that option in the ~/.ssh/config file for a specified host? |
|
Back to top |
|
 |
desultory Bodhisattva


Joined: 04 Nov 2005 Posts: 9410
|
Posted: Tue Apr 01, 2008 7:13 am Post subject: |
|
|
alex.blackbit wrote: | the last question is: is there a way to set that option in the ~/.ssh/config file for a specified host? | Not that I know of, that is why a wrapper would potentially be useful, though the general form would be slightly more complex than the example I posted. |
|
Back to top |
|
 |
|