SSH - please make my life easier


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers SSH - please make my life easier
# 1  
Old 10-12-2010
SSH - please make my life easier

I know this is probably a really stupid question, with a really stupidly simple answer.

So I've got a Mac, and I have to do a bunch of work via SSH on a Solaris workstation owned by my university.

I've already got keys set up, and my ~/.ssh/config file set up as follows:
Code:
Host prime
  HostName address.of.that.workstation
  User myusername

And so all I have to do to SSH into the box is type "ssh prime". I've even got a separate window setting in Terminal.app with a different background color that's set to run that command on startup; I've set Terminal.app to open one of those windows in a second tab when I start it.

The only problem is, when I ssh into the box (or log into it physically, come to think of it) I get csh.

And I want bash. Not because of anything regarding scripts or anything - I am a complete noob - but because of the arrow keys. (If I have to use a command line argument, I'm OK with that; I mainly want to be able to invoke bash automatically when I open the aforementioned window setting. Right now, it's really annoying when I ssh in, then forget to start bash and end up with arrow-key control characters all over the screen.)

I've tried "chsh", but as I mentioned earlier, it's a Solaris box.
I've tried "passwd -e" and even, in a futile attempt, "usermod -s" but, as you can expect, nada. (Did I mention the workstation is owned by my university?)
I'd try contacting the sysadmin, but I don't even know for sure who that is, and I can guess how much good will come out of it.
I'd try editing my ~/.profile and ~/.login files, but both of them have huge comment blocks at the top that say "DO NOT PUT ANY COMMANDS IN THIS FILE THAT CHANGE THE SHELL THAT YOU RUN. IF YOU DO, YOU WILL NOT BE ABLE TO LOG ONTO A WORKSTATION." This scares me.

Any ideas?

Last edited by oboewan; 10-12-2010 at 06:56 PM..
# 2  
Old 10-12-2010
Does your sun host even have bash?

You can force a shell like this without having to put it in .profile, if your host has it:

Code:
ssh -t username@host exec /bin/bash

If they don't have bash, they should at least have ksh, which can be made to act somewhat more intelligently/familiarly with set -o emacs.
# 3  
Old 10-12-2010
Thanks! That worked perfectly.

Yes, they do have bash, they just force us to use csh as a login shell for some reason. Seriously.
# 4  
Old 10-12-2010
You can also add these lines at the end of your .login file:

Code:
echo -n "Switch to bash ? [y]/n "
set answer = $< 
switch ($answer)
    case [nN]:
      echo "Staying in csh"
      breaksw
    default:
      exec /bin/bash
      breaksw
endsw

# 5  
Old 10-12-2010
Quote:
Originally Posted by jlliagre
@corona688: csh != ksh
I stealth-edited while you were writing Smilie Sorry

Better to handle it on his end if he can IMHO, if their login requirements really are that strict anywhere.
# 6  
Old 10-12-2010
Quote:
Originally Posted by Corona688
I stealth-edited while you were writing Smilie Sorry
So did I Smilie
# 7  
Old 10-12-2010
But I had the sense to quote you first. Mwahahah.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

6 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

An easier way to move character from field to a new line

Hi ! Is there a more convenient way to do the following: When, in $2, there is more then one letter (separated by ","), it returns the letter on the second position to a new line in $2 with the same content in $1 and $3 as the line this letter comes from. infile: aaaaa A,B 1,2,3,4,5... (6 Replies)
Discussion started by: lucasvs
6 Replies

2. Shell Programming and Scripting

Make ssh and send commands

Hi, I'm trying to make an SSH into a SGSN node and collect some commands printouts.:confused: I really don't know how this can be done. I think it must be like this: #!/bin/bash ssh user@192.168.88.10 Then I must enter the password, but I don't know how to do it, I tried with: echo... (3 Replies)
Discussion started by: nagomes
3 Replies

3. UNIX for Advanced & Expert Users

End of Life / Life Cycle Information

Hello everyone, I was searching for locations where I can get End of Life information on multiple versions of Unix. I have found some information which I list below, what I have not found or confirmed is where I can get the information for: DEC Unix/OSF1 V4.0D NCR Unix SVR4 MP-RAS Rel 3.02.... (2 Replies)
Discussion started by: robertmcol
2 Replies

4. UNIX for Dummies Questions & Answers

how to make ssh to behave as rsh

hi frnds, how to make the ssh service to behave as rsh.as we know ssh asks for passwd whereas the rsh doesnt.so how can i perform the followin operation without being asked for passwd. lets say i want to run the command "ls" on "remote_terminal" $ssh remote_terminal ls the above should work... (1 Reply)
Discussion started by: mxms755
1 Replies

5. Shell Programming and Scripting

Help make script much easier

Is there any method to realise this in one command? Thanks in advance (2 Replies)
Discussion started by: GCTEII
2 Replies

6. Cybersecurity

Dancing a samba is easier :(

Hello everybody, I am trying to get a suse linux computer ( 7.2 ) to show me my home directory under windows. I got samba started, and I can see the linux computer under windows, but when I try to open it, I get a login box. That is not so bad :) but I can't log on. I am using windows 2000 and I... (5 Replies)
Discussion started by: Micky
5 Replies
Login or Register to Ask a Question