ezjail-admin -e <command> consolname

Helo,

I want to start ssh on my jail in a shell script like
Code:
ezjail-admin -e service sshd onestart <consolename>

With
Code:
ezjail-admin -e passwd <consolename>
or
Code:
ezjail-admin -e adduser <consolename>
it works but not with ssh, I need it on shell; how?
 
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]
 
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.
 
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?
 
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>

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?

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

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

regards
Johan
 
Sylhouette said:
I think you need to quote only the text, and not the whole command eg the >>
Try the following

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

regards
Johan

Don't work.
It only save it on the hostsystem.
I think, i find a way to do this.
e.g.
Code:
 echo "welcome" >> /usr/jails/<consolename>/root/welcome.txt
 
Back
Top