Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am using expect to auto login on SSH from an Unity launcher, the command looks something like this:

gnome-terminal -t SSH1 -e "expect -c 'spawn ssh [email protected] ; expect assword ; send \\"password123\\n\\" ; interact'"

That works fine for logging in automatically, but if I maximize the gnome-terminal window, the ssh shell contents remain smaller as if the window had the default size, like this:

screenshot

At first I thought it was because the gnome-terminal was being launched with the default size and when maximized for some reason the ssh stuff didn't resize, but then I added gnome-terminal --window --maximize to the command, and the same problem remains, the window starts maximized but the ssh shell text still is the size of the default terminal.

Also if I just open a terminal and type that command on the top, I have the same problem as if I start it from the Unity launcher.

Any ideas what could cause this and how to fix it?

share|improve this question
4  
Not an answer: using ssh with ssh-keys works great, you can resize, and it is more secure than writing the pain password in a command (probably put in a script or an alias). So, why don't you use ssh-keys? (Also, I cannot get your command, opportunely modified, to run, so I cannot try). –  enzotib Jan 8 '12 at 17:12
    
@enzotib I will take a look at ssh-keys but I never used them, Im not sure how to set them up. And its weird the commands doesn't work for you, I just copy paste the cmd on my question into a terminal, and it works. –  nirgxx Jan 8 '12 at 17:46

1 Answer 1

a better way to get the effect you want is to use ssh keys like enzotib suggested.

First

$ mkdir ~/.ssh
$ chmod 700 ~/.ssh
$ ssh-keygen -t rsa

press enter at each prompt leaving the fields blank will create a default key with no password. This is what you want.

Next push the public key to the server.

$ ssh-copy-id [email protected]

Finally create a launcher with the command:

gnome-terminal -t SSH1 -x ssh [email protected]
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.