[HOWTO] Log in a jail using his name
Posted: 23 Jan 2013 14:53
I find this interesting article: http://blog.valqk.com/archives/FreeBSD- ... nd-20.html
Welcome to the XigmaNAS community forum!
https://www.xigmanas.com/oldforums/
https://www.xigmanas.com/oldforums/viewtopic.php?f=79&t=2427
Do you mean somethig like this:alexey123 wrote:But better way - create into jail SSH server and log into without nas4free host
extract from : http://www.cyberciti.biz/faq/howto-setu ... th-ezjail/How Do I Login Remotely (Directly) To Jail?
First, login using jexec command. Add the following line to jail /etc/rc.conf:
# echo 'sshd_enable="YES"' >> /etc/rc.conf
Open sshd_config file and update listen parameter to bind to jail IP only. Start OpenSSH server inside the jail:
# /etc/rc.d/sshd start
# sockstat -4

Code: Select all
jexec 1 adduserAfter this see for example /var/etc/ssh/sshd_config and edit jail's /etc/ssh/sshd_config with some directives. But minor - under jail your root not have password, I defineUsername:
Full name:
Uid (Leave empty for default):
Login group []: wheel
Login group is wheel. Invite alexey into other groups? []:
Login class [default]:
Shell (sh csh tcsh nologin) [sh]: csh
Home directory []:
Home directory permissions (Leave empty for default):
Use password-based authentication? [yes]: yes
Use an empty password? (yes/no) [no]:
Use a random password? (yes/no) [no]:
Enter password:
Enter password again:
Lock out the account after creation? [no]:
Username :
Password : *****
Full Name :
Uid : 1001
Class :
Groups : wheel
Home :
Home Mode :
Shell : /bin/csh
Locked : no
OK? (yes/no): yes
adduser: INFO: Successfully added () to the user database.
Add another user? (yes/no): no
Goodbye!
Code: Select all
PermitRootLogin noCode: Select all
/etc/rc.d/sshd start