# Script Problem: ssh user@server <command>



## Sisler_Ohan (Sep 29, 2011)

Hay,

I want to login from my first root to my second root and execute a command like this:


```
ssh root@<hostname> "cd /usr/ports/databases/mysql50-server && make install clean"
```

The problem is, I do not get the 'dialog' to enter 'ok' or 'cancel' to begin or abort the installation.
Because it is very important to install this from my first root on my second root.
Please help.


----------



## VoViK (Sep 29, 2011)

hi, you can try use 
	
	



```
BATCH=yes
```


```
ssh root@<hostname> "cd /usr/ports/databases/mysql50-server && make BATCH=yes install clean"
```


----------



## Sisler_Ohan (Sep 29, 2011)

Hi, what does that mean 
	
	



```
BATCH=YES"
```


----------



## VoViK (Sep 30, 2011)

Please check man ports() ENVIRONMENT section


----------



## Sisler_Ohan (Sep 30, 2011)

hi,

ok thankt it works!


----------



## phoenix (Sep 30, 2011)

Also check the ssh(8) page for a description of the *-t* option.

And disable root logins via ssh.  You really don't want to do that.  Install security/sudo and configure that to allow a non-root user to execute things as root.


----------



## Sisler_Ohan (Sep 30, 2011)

phoenix said:
			
		

> Also check the ssh(8) page for a description of the *-t* option.
> 
> And disable root logins via ssh.  You really don't want to do that.  Install security/sudo and configure that to allow a non-root user to execute things as root.



Sure i'll do that.
But first i had to check how that works with my problem  i only use normal accounts and private keys for ssh login.


----------

