# ezjail-admin -e <command> consolname



## Sisler_Ohan (Sep 26, 2011)

Helo,

I want to start ssh on my jail in a shell script like 
	
	



```
ezjail-admin -e service sshd onestart <consolename>
```

With 
	
	



```
ezjail-admin -e passwd <consolename>
```
 or

```
ezjail-admin -e adduser <consolename>
```
 it works but not with ssh, I need it on shell; how?


----------



## DutchDaemon (Sep 26, 2011)

Start daemons either with the service(8) command or the start script (/etc/rc.d/sshd).


----------



## Sisler_Ohan (Sep 26, 2011)

I mean how I can enter more commands [cmd=]ezjail-admin -e echo helo there how r u <consolename>[/cmd]
I only can use 1 word as command, I want more like [cmd=]echo hi there who r u or other[/cmd]


----------



## DutchDaemon (Sep 26, 2011)

Put quotes around the command if it contains spaces.

[cmd=]echo "This is more than one word"[/cmd]

This is rather elementary. I suggest you read up on using command lines and shells.

If it's not that, produce the exact error you are seeing. It may have to do with PATH.


----------



## Sisler_Ohan (Sep 28, 2011)

Hi,

Ok, with [cmd=]ezjail-admin console -e "command with spaces" <console>[/cmd] it works.

but now I have a problem with "echo text" to the jail from the host. So I want to do this:

[cmd=]ezjail-admin console -e "echo welcome >> readme.txt" <console>[/cmd]

So it means I will enter "echo welcome" to readme.txt but the readme.txt have to be on the new jail.
If I try this, I only find the readme.txt on the hostsystem, not on the jail.

You know what I mean?


----------



## Sylhouette (Sep 29, 2011)

> but now I have a problem with "echo text" to the jail from the host. So I want to do this:
> 
> ezjail-admin console -e "echo welcome >> readme.txt" <console>
> 
> ...



I think you need to quote only the text, and not the whole command eg the >>
Try the following


```
ezjail-admin console -e "echo welcome" >> readme.txt <console>
```

regards
Johan


----------



## Sisler_Ohan (Sep 29, 2011)

Sylhouette said:
			
		

> I think you need to quote only the text, and not the whole command eg the >>
> Try the following
> 
> 
> ...



Don't work.
It only save it on the hostsystem.
I think, i find a way to do this.
e.g. 
	
	



```
echo "welcome" >> /usr/jails/<consolename>/root/welcome.txt
```


----------

