ssh jail?

Rick Stevens ricks at alldigital.com
Mon Jan 25 19:33:21 UTC 2016


On 01/25/2016 06:55 AM, Jeffrey Ross wrote:
> I'm in the process of setting up an SSH jail, for the most part its
> working as expected with one exception, I want to provide access to
> /dev/ttyUSB0 through /dev/ttyUSB4 (not 2) via cu.
>
> When I attempt to use "cu -lttyUSB0 -s9600" I always get "line in use"
> even through it is not in use and from another account not restricted to
> the "jail" I can successfully connect to the ttyUSB0.
>
> I've tried creating $chroot/
>
> run/
>      lock/
>      lockdev/
>      uucp/
> var/
>      run -> symbolic link to $chroot/run
>      lock -> symbolic link to $chroot/run/lock
>
> and then matched the directory permissions so they are the same as the
> "real" system.
>
> ls -l $chroot/dev/ttyUSB?
>      crwxrwxrwx 1 root dialout 188, 0 Jan 24 14:48 ttyUSB0
>      crwxrwxrwx 1 root dialout 188, 1 Jan 24 14:49 ttyUSB1
>      crwxrwxrwx 1 root dialout 188, 3 Jan 24 14:49 ttyUSB3
>      crwxrwxrwx 1 root dialout 188, 4 Jan 24 14:49 ttyUSB4
>
> The dialout group is 18 and the user is in group 18, initially I set the
> permissions for the ttyUSB? to 660 before changing it to 777 as a last
> ditch effort.
>
> The "real" /dev/ttyUSB? -
>
> ls -l /dev/ttyUSB?
>      crw-rw---- 1 root dialout 188, 0 Jan 24 14:44 /dev/ttyUSB0
>      crw-rw---- 1 root dialout 188, 1 Jan 23 21:48 /dev/ttyUSB1
>      crw-rw---- 1 root dialout 188, 3 Jan 24 15:12 /dev/ttyUSB3
>      crw-rw---- 1 root dialout 188, 4 Jan 23 21:48 /dev/ttyUSB4
>
> I'm probably missing something simple and any suggestions would be
> appreciated.

Uhm, double check the permissions on the $chroot/var/run  and
$chroot/var/lock directories and make sure that the user you're trying
to run as has write permissions in those directories. It's been a
while, but IIRC the only way cu can determine if a device is in use is
by checking the lock files and if it can't create a lock file, it says
the device is in use.

Why in the devil would you pull out that ancient program anyway? Man!
I haven't even LOOKED at cu/uucp in 15 years at least!
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ricks at alldigital.com -
- AIM/Skype: therps2        ICQ: 226437340           Yahoo: origrps2 -
-                                                                    -
-  Money can't buy happiness, but it can take the sting out of being -
-                             miserable!                             -
----------------------------------------------------------------------


More information about the users mailing list