
I've encountered a thoroughly interesting and somewhat perplexing issue with a user login. The basic symptom is that the user can't login - and as root I can't complete an su as that user. # su - username (hangs) ^C /var/log/secure however suggests a successful connection.. Jan 18 12:25:11 machine su: pam_unix(su-l:session): session opened for user username by root(uid=0) Jan 18 12:26:01 machine su: pam_unix(su-l:session): session closed for user username Now we have a system where the several hundred users in /home are actually symlinks to NFS attached storage on /data/user[1..2]. Which is the case for this user. [user2]# ls -lad username/ drwxr-xr-x 46 username groupname 8192 Jan 15 07:53 username/ # pwd /data/user2 However when running an ls on the login node it shows they have a directory in home that is *not* a symlink, unlike others. # ls -lad /home/username drwxr-xr-x 46 username groupname 8192 Jan 15 07:53 /home/username/ # ls -lad /home/lev lrwxrwxrwx 1 lev home 15 Apr 15 2014 /home/lev -> /data/user1/lev *Except* when one does a directory listing from /home itself (where it has a different groupname)! [root@edward home]# ls -la /home/ .. lrwxrwxrwx 1 username home 19 Jul 26 2013 sanujig -> /data/user2/username Note that the two directories have the same inode. # ls -id /home/username/ 1081162059 /home/sanujig/ ]# ls -id /data/user2/username 1081162059 /data/user2/username Fascinating, eh? -- Lev Lafayette, BA (Hons), GradCertTerAdEd (Murdoch), GradCertPM, MBA (Tech Mngmnt) (Chifley) mobile: 0432 255 208 RFC 1855 Netiquette Guidelines http://www.ietf.org/rfc/rfc1855.txt

On 18/01/16 12:42, Lev Lafayette via luv-main wrote:
Note that the two directories have the same inode.
# ls -id /home/username/ 1081162059 /home/sanujig/
]# ls -id /data/user2/username 1081162059 /data/user2/username
So you're saying someone accidentally made a hardlink rather than a softlink? Cheers, Andrew

Andrew Pam via luv-main <luv-main@luv.asn.au> writes:
So you're saying someone accidentally made a hardlink rather than a softlink?
... except it isn't possible to have a hard link to a directory, and it most definitely isn't possible to have hard links between file systems. I am going to reread Lev's email, and respond there. I think I see what is causing some confusion. -- Brian May <brian@linuxpenguins.xyz> https://linuxpenguins.xyz/brian/

On Mon, 18 Jan 2016 01:13:08 PM Brian May via luv-main wrote:
So you're saying someone accidentally made a hardlink rather than a softlink?
... except it isn't possible to have a hard link to a directory, and it most definitely isn't possible to have hard links between file systems.
You can have bind mounts which act like hard links between directories and go across filesystems. -- My Main Blog http://etbe.coker.com.au/ My Documents Blog http://doc.coker.com.au/

Lev Lafayette via luv-main <luv-main@luv.asn.au> writes:
Note that the two directories have the same inode.
# ls -id /home/username/ 1081162059 /home/sanujig/
]# ls -id /data/user2/username 1081162059 /data/user2/username
Fascinating, eh?
Ok, going to respond to the easiest part first. That is actually expected behaviour for symlinks. Because you had a slash at the end of the directory, you dereference the symlink first, so you get the directory entry in both cases. % ln -s vpac vpac2 % ls -l vpac2 lrwxrwxrwx 1 brian brian 4 Jan 18 13:12 vpac2 -> vpac % ls -id vpac2/ 7476864 vpac2/ % ls -id vpac/ 7476864 vpac/ % ls -id vpac2 22807075 vpac2 -- Brian May <brian@linuxpenguins.xyz> https://linuxpenguins.xyz/brian/

Lev Lafayette via luv-main <luv-main@luv.asn.au> writes:
However when running an ls on the login node it shows they have a directory in home that is *not* a symlink, unlike others.
# ls -lad /home/username drwxr-xr-x 46 username groupname 8192 Jan 15 07:53 /home/username/ # ls -lad /home/lev lrwxrwxrwx 1 lev home 15 Apr 15 2014 /home/lev -> /data/user1/lev
*Except* when one does a directory listing from /home itself (where it has a different groupname)!
[root@edward home]# ls -la /home/ .. lrwxrwxrwx 1 username home 19 Jul 26 2013 sanujig -> /data/user2/username
Ok, this is a bit weird. I suspect something weird going on with NFS. Also just just sanity checking - /home and /data/user2 are seperate NFS partitions right? What happens if you type in the above commands on the NFS server? I am expecting everything should be fine on the server, but be good to confirm. A bigger problem I see however is the name "edward" in the prompt. As Edward was going to be decommisioned months ago, that must be a copy and paste error, right? -- Brian May <brian@linuxpenguins.xyz> https://linuxpenguins.xyz/brian/
participants (4)
-
Andrew Pam
-
Brian May
-
Lev Lafayette
-
Russell Coker