Archive of articles classified as' "Linux"

Back home

PTY allocation request failed on channel 0

20/02/2009

Yesterday, I was trying to login to my machine and I got the following message:

PTY allocation request failed on channel 0

My prompt was stuck and I could not enter commands. This happened because -for some reason- the tty related devices(/dev/ptmx, /dev/pts) were not created or mounted on my machine. In order to get this problem resolved, I created and mounted the missing devices using the following commands:

rm -rf /dev/ptmx
mknod /dev/ptmx c 5 2
chmod 666 /dev/ptmx
umount /dev/pts
rm -rf /dev/pts
mkdir /dev/pts
mount /dev/pts

In order to be able to execute commands you will have to login to your machine(isn’t this supposed to be the original problem :) ).
This will do the trick:

ssh user@host "/bin/bash -i"

My VPS is built on openVZ but I have seen this problem occur also in XEN machines.
Leave me a comment if this works for you!

89 Comments

Tethereal command line notes

15/02/2009

Exclude host 10.16.21.206 from sniffing AND resolve hostnames

tethereal -N n -f 'host not 10.16.21.206'
1 Comment

Some useful Redhat Package Manager(RPM) commands

15/02/2009

Getting the dependencies of a file:

rpm -q --requires -p package.rpm

Formating the query result of RPM database

rpm -qa –queryformat '["_%{NAME}",list("%{VERSION}-%{RELEASE}","%{ARCH}"),\n]'

Result:

“_openssh”,list(”3.6.1p2-33.30.6″,”i386″),
“_XFree86-Mesa-libGLU”,list(”4.3.0-97.EL”,”i386″),
…

Display a file-per-package list

rpm -qa --queryformat '[%{NAME}\t%{FILENAMES}\n]'

Result:

kernel-smp             /lib/modules/2.6.9-67.0.20.ELsmp/kernel/sound/pci/snd-atiixp-modem.ko
kernel-smp             /lib/modules/2.6.9-67.0.20.ELsmp/kernel/sound/pci/snd-atiixp.ko
kernel-smp             /lib/modules/2.6.9-67.0.20.ELsmp/kernel/sound/pci/snd-azt3328.ko
kernel-smp             /lib/modules/2.6.9-67.0.20.ELsmp/kernel/sound/pci/snd-bt87x.ko
kernel-smp             /lib/modules/2.6.9-67.0.20.ELsmp/kernel/sound/pci/snd-cmipci.ko
kernel-smp             /lib/modules/2.6.9-67.0.20.ELsmp/kerne
krb5-workstation   /usr/kerberos/bin/ftp
krb5-workstation   /usr/kerberos/bin/gss-client
krb5-workstation   /usr/kerberos/bin/kdestroy
krb5-workstation   /usr/kerberos/bin/kinit
krb5-workstation   /usr/kerberos/bin/klist
1 Comment

Faking a windows dhcp server with dhcp-client-identifier

15/02/2009

Windows DHCP server, require (that the DHCP client will send) the client’s dhcp identifier in order to give an IP to a machine that just entered the network. This leads to problems when there are linux clients that request IP adresses from Windows DHCP servers(Windows server 2003 or 2008). This happens because, by default, linux dhcp clients do not send their DHCP “client identifier”. Thus the DHCP server does not recognize them and they cannot get an IP dynamically.

To solve this, just put the following in: /etc/dhclient.conf

send host-name “yourhostnamehere”
send dhcp-client-identifier 1:your_macaddress_here

Restart your dhcp client (or reboot your computer) and hopefully you will get an IP.

2 Comments

Enabling Greek(Ελληνικά) on Asus WL500gP

15/02/2009

This is done in irder to get Greek filenames working in my wonderful Asus WL500gP router. I use samba3 and Oleg’s firmware.

For Greek(Ελληνικά) filenames the correct steps are the following:

nvram set usb_vfat_options=defaults,utf8
nvram set usb_smbcpage_x=737
nvram set usb_smbcset_x=1253
nvram commit

and the contents of my smb.conf:

[global]
workgroup = WORKGROUP
guest account = admin
security = share
browseable = yes
writeable = yes
guest ok = yes
guest only = yes
log level = 1
max log size = 100
encrypt passwords = yes
dns proxy = no
netbios name = Plethon
server string = wl500gPremium customized by Asterios
unix charset = UTF-8
dos charset = 1253
display charset = UTF-8

[Files]
path=/tmp/harddisk/Files
writeable = yes
browseable =yes
read only = no

[Downloads]
path=/tmp/harddisk/downloads
writeable = yes
browseable =yes
read only = no

good luck!

No Comments