Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ssh connection with non-standard shell
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
alex.blackbit
Advocate
Advocate


Joined: 26 Jul 2005
Posts: 2397

PostPosted: Sat Mar 29, 2008 8:57 pm    Post subject: ssh connection with non-standard shell Reply with quote

hi,

can i open a (open)ssh connection and execute a shell on the remote computer?
i tried with
Code:
$ ssh host zsh
but 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
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Sun Mar 30, 2008 9:31 am    Post subject: Reply with quote

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
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5956

PostPosted: Sun Mar 30, 2008 9:45 am    Post subject: Reply with quote

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
View user's profile Send private message
alex.blackbit
Advocate
Advocate


Joined: 26 Jul 2005
Posts: 2397

PostPosted: Sun Mar 30, 2008 11:05 pm    Post subject: Reply with quote

@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
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Sun Mar 30, 2008 11:38 pm    Post subject: Reply with quote

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
View user's profile Send private message
alex.blackbit
Advocate
Advocate


Joined: 26 Jul 2005
Posts: 2397

PostPosted: Sun Mar 30, 2008 11:41 pm    Post subject: Reply with quote

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
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Mon Mar 31, 2008 2:09 am    Post subject: Reply with quote

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
View user's profile Send private message
alex.blackbit
Advocate
Advocate


Joined: 26 Jul 2005
Posts: 2397

PostPosted: Mon Mar 31, 2008 1:40 pm    Post subject: Reply with quote

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
Code:
$ ssh -t host zsh

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
View user's profile Send private message
desultory
Bodhisattva
Bodhisattva


Joined: 04 Nov 2005
Posts: 9410

PostPosted: Tue Apr 01, 2008 7:13 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum