The Official *nix Thread

Inane baanter or words of wisdom - you decide...
Post Reply
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

JQW wrote:The UID and GID of the users are probably different between the two systems.

You need to change them manually for each user with find and chown/chgrp - eg:

Code: Select all

find / -gid 1034 -exec chgrp 506{} \;
Okay, thanks - can you explain the command string above? What are the numbers denoting?
Using "ls -lna /home/jon" gives all files and directories under /home/jon as having the correct UID and GID of 500 as specified in the /etc/passwd file, so I'm assuming (as you say) the UID/GID is different somewhere else (specifically with logging in).
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Kelloggs
Baaaaa!
Baaaaa!
Posts: 1859
Joined: Wed Jun 22, 2005 11:38 pm 0
XBL Gamertag: TheAntiKelloggs
Location: Widnes or Altrincham. Take your pick.

Re: The Official *nix Thread

Post by Kelloggs »

The English expansion of

Code: Select all

find / -gid 1034 -exec chgrp 506{} \;
would be:
recursively find, starting at /, anything having group ID number 1034, then on finding a matching thing, execute the chgrp command to change the group ID of that thing to 506
approximately. :wink:

The English translation would be "tear through the filesystem, from the top down, changing group to 506 on anything currently grouped as 1034"

Damn useful command, find; also damn impenetrable.
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Kelloggs wrote:The English expansion of

Code: Select all

find / -gid 1034 -exec chgrp 506{} \;
would be:
recursively find, starting at /, anything having group ID number 1034, then on finding a matching thing, execute the chgrp command to change the group ID of that thing to 506
approximately. :wink:

The English translation would be "tear through the filesystem, from the top down, changing group to 506 on anything currently grouped as 1034"

Damn useful command, find; also damn impenetrable.
Doesn't that assume that I know what /home/jon is currently grouped as if not 500?
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
xav
Baaaaaa!
Baaaaaa!
Posts: 2455
Joined: Thu Jun 06, 2002 5:32 pm 0
Location: Bucks, UK
Contact:

Re: The Official *nix Thread

Post by xav »

I could be wrong but I don't think your problem is UID/GID mismatches anyway. Whenever I've had that problem, "ls -l" shows either the numeric form of the ID (if there's no corresponding entry in /etc/passwd), or the wrong name if there is an entry for that ID in /etc/passwd, but it's a different person.

Usually in cases of mismatched IDs doing a "sudo chown -R fred.fred *" does the trick.

To be certain, use "ls -n" which lists the UID/GID in numeric format. That should show you whether "jon" really does translate to the ID you expect.
Co-creator of The Greys, Monsters, Inked & Elvie webcomics
• Web Site • Twitter • Patreon •
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

xav wrote:I could be wrong but I don't think your problem is UID/GID mismatches anyway. Whenever I've had that problem, "ls -l" shows either the numeric form of the ID (if there's no corresponding entry in /etc/passwd), or the wrong name if there is an entry for that ID in /etc/passwd, but it's a different person.

Usually in cases of mismatched IDs doing a "sudo chown -R fred.fred *" does the trick.

To be certain, use "ls -n" which lists the UID/GID in numeric format. That should show you whether "jon" really does translate to the ID you expect.
No effect, sadly.

ls-lan shows everything set to "500", which corresponds to the entry in /etc/passwd, so it isn't that...

Code: Select all

[jon@joshua11 ~]$ ls -an
total 204
drwx------. 32 500 500  4096 2010-01-07 10:03 .
drwxr-xr-x.  5   0   0  4096 2009-07-13 10:03 ..
drwxrwxr-x. 20 500 500  4096 2010-01-05 01:47 Backup
-rw-------.  1 500 500 10374 2010-01-07 08:33 .bash_history
-rw-r--r--.  1 500 500    18 2008-02-29 14:27 .bash_logout
-rw-r--r--.  1 500 500   176 2008-02-29 14:27 .bash_profile
-rw-r--r--.  1 500 500   124 2008-02-29 14:27 .bashrc
drwx------.  3 500 500  4096 2008-05-25 22:36 .bittorrent
drwxr-xr-x.  2 500 500  4096 2010-01-05 01:31 .cache
drwxr-xr-x.  4 500 500  4096 2010-01-05 01:31 .config
drwx------.  3 500 500  4096 2010-01-05 01:31 .dbus
drwxr-xr-x.  2 500 500  4096 2010-01-05 01:31 Desktop
drwxrwxr-x.  2 500 500  4096 2010-01-06 16:28 Documents
drwxrwxr-x.  4 500 500  4096 2010-01-04 13:16 Downloads
-rw-------.  1 500 500    16 2010-01-05 01:31 .esd_auth
drwx------.  4 500 500  4096 2010-01-05 01:31 .gconf
drwx------.  2 500 500  4096 2010-01-05 01:33 .gconfd
drwxr-xr-x.  6 500 500  4096 2010-01-05 01:33 .gnome2
drwx------.  2 500 500  4096 2010-01-05 01:31 .gnome2_private
drwxrwxr-x.  3 500 500  4096 2010-01-05 01:31 .gnote
drwx------.  2 500 500  4096 2010-01-05 01:31 .gnupg
-rw-rw-r--.  1 500 500   127 2010-01-05 01:31 .gtk-bookmarks
drwx------.  2 500 500  4096 2010-01-05 01:31 .gvfs
-rw-------.  1 500 500   314 2010-01-05 01:31 .ICEauthority
-rw-r--r--.  1 500 500   626 2010-01-05 01:31 .imsettings.log
drwxr-xr-x.  3 500 500  4096 2010-01-05 01:31 .local
drwxr-xr-x.  4 500 500  4096 2008-05-25 18:34 .mozilla
drwxr-xr-x.  2 500 500  4096 2010-01-05 01:31 Music
-rw-------.  1 500 500   504 2009-07-08 00:15 .mysql_history
drwxr-xr-x.  2 500 500  4096 2010-01-05 01:31 .nautilus
drwxr-xr-x.  2 500 500  4096 2010-01-05 01:31 Pictures
drwxrwxr-x.  5 500 500  4096 2010-01-06 16:07 Platforms
drwxrwxr-x.  7 500 500  4096 2010-01-04 13:00 Programs
drwxr-xr-x.  2 500 500  4096 2010-01-05 01:31 Public
drwx------.  2 500 500  4096 2010-01-05 01:31 .pulse
-rw-------.  1 500 500   256 2010-01-05 01:31 .pulse-cookie
-rw-------.  1 500 500   218 2010-01-05 01:33 .recently-used.xbel
drwxr-xr-x.  5 500 500  4096 2010-01-04 14:51 RHCT
drwxrwxr-x.  4 500 500  4096 2010-01-04 14:56 SCJP
drwx------.  2 500 500  4096 2010-01-05 01:31 .ssh
drwxr-xr-x.  2 500 500  4096 2010-01-05 01:31 Templates
drwxrwxr-x.  2 500 500  4096 2010-01-06 16:28 Torrent-Files
drwxr-xr-x.  2 500 500  4096 2010-01-05 01:31 Videos
-rw-------.  1 500 500 12553 2010-01-07 10:02 .viminfo
-rw-r--r--.  1 500 500   658 2008-01-31 14:46 .zshrc
and the corresponding /etc/passd entry...

Code: Select all

jon:x:500:500:Jonathan:/home/jon:/bin/bash
??? :?
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Code: Select all

[root@joshua11 ~]# ls --context /home
drwx------. jon    jon    system_u:object_r:file_t:s0      jon
drwx------. root   root   system_u:object_r:file_t:s0      lost+found
[root@joshua11 ~]# ls --context /home/jon
drwxrwxr-x. jon jon unconfined_u:object_r:user_home_t:s0 Backup
drwxr-xr-x. jon jon unconfined_u:object_r:user_home_t:s0 Desktop
drwxrwxr-x. jon jon unconfined_u:object_r:user_home_t:s0 Documents
drwxrwxr-x. jon jon unconfined_u:object_r:user_home_t:s0 Downloads
drwxr-xr-x. jon jon unconfined_u:object_r:user_home_t:s0 Music
drwxr-xr-x. jon jon unconfined_u:object_r:user_home_t:s0 Pictures
drwxrwxr-x. jon jon unconfined_u:object_r:file_t:s0  Platforms
drwxrwxr-x. jon jon unconfined_u:object_r:user_home_t:s0 Programs
drwxr-xr-x. jon jon unconfined_u:object_r:user_home_t:s0 Public
drwxr-xr-x. jon jon unconfined_u:object_r:user_home_t:s0 RHCT
drwxrwxr-x. jon jon unconfined_u:object_r:user_home_t:s0 SCJP
drwxr-xr-x. jon jon unconfined_u:object_r:user_home_t:s0 Templates
drwxrwxr-x. jon jon unconfined_u:object_r:file_t:s0  Torrent-Files
drwxr-xr-x. jon jon unconfined_u:object_r:user_home_t:s0 Videos
Ah, this seems to show something different - the two directories I've added since I've run this drive (Platforms and Torrent-Files) from this new machine have different entries to the directories that were still there before - what does this mean? (I was told to run this command by someone over at the Fedora forums...)
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Gah, fixed it by shunting everything to another directory, deleting the user and recreating it and shunting everything back. It's fixed it, but I'd prefer to know why it happened in the first place.
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Baggypants
Baaaaaaa!
Baaaaaaa!
Posts: 5328
Joined: Sun Mar 19, 2006 12:54 pm 0
Location: Salford(UK);
Contact:

Re: The Official *nix Thread

Post by Baggypants »

Hurray, Due to being snowed in and bored I solved my apt authentication issues and upgraded my dusty 8.10 Ubuntu install, to 9.10 and it FINALLY runs my monitor at 1920x1080. I can now legitimately to do a workday in Linux as most of the tools I use now are Java (See you Access, you old cruftbag) Java apps now seem to pick up the Gnome theme too, which I don't remember happening previously.

Now, I see someone has got Torchlight running in wine, time to have a go at that.
"The eggs, get them!"
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Baggypants wrote:Hurray, Due to being snowed in and bored I solved my apt authentication issues and upgraded my dusty 8.10 Ubuntu install, to 9.10 and it FINALLY runs my monitor at 1920x1080. I can now legitimately to do a workday in Linux as most of the tools I use now are Java (See you Access, you old cruftbag) Java apps now seem to pick up the Gnome theme too, which I don't remember happening previously.

Now, I see someone has got Torchlight running in wine, time to have a go at that.
Heh - I've got the day off work tomorrow before the wittle fambily turns up...I think I'm going to get up early and play with Linux and watch the snow pile up outside :D

Jeez, I'm such a geek...
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
disciple
Sheepie Whore
Sheepie Whore
Posts: 13941
Joined: Mon Oct 27, 2003 11:33 pm 0
XBL Gamertag: LiberMentis
PSN: Prime_Heretic
Location: Greenfield
Contact:

Re: The Official *nix Thread

Post by disciple »

Baggypants wrote:I see someone has got Torchlight running in wine, time to have a go at that.
Heh cheers for that, bought Torchlight off Steam a while ago when it was on cheap. Tried it in Wine and it worked right away with no issues, been playing it all day.

It's running on all the highest graphics settings too.
PS4 : Prime_Heretic
Steam: bitstorm
Elite Dangerous: Cmdr Britain
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Okay, this has got me stumped.

FTP server works, right? Anonymous user disabled, chroot jailed, works with all proper FTP clients I've thrown at it. However, when trying to connect via Firefox with ftp://<server>, the server prompts me for my login details like it should and then waits a bit before throwing me a "425 - Could not establish a connection" error. In my /var/log/secure log, I see: -

Code: Select all

Jan 13 13:30:45 joshua11 vsftpd[14194]: pam_unix(vsftpd:auth): check pass; user unknown
Jan 13 13:30:45 joshua11 vsftpd[14194]: pam_unix(vsftpd:auth): authentication failure; logname= uid=0 euid=0 tty=ftp ruser=anonymous rhost=<MY IP ADDRESS>
Jan 13 13:30:45 joshua11 vsftpd[14194]: pam_succeed_if(vsftpd:auth): error retrieving information about user anonymous
It looks as though the browser is trying to login as an anonymous user, which my server won't allow. Why is Firefox prompting me for my login details via a dialog box and then not supplying the server with the correct login credentials?

Even ftp://<user:<pass>@<server> doesn't work, as I go directly to the 425 connection error.

Huh? :?
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Ah, Firefox apparently doesn't support active mode. Okay, passive mode it is then...
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

(I keep looking for this in the Programming forum!)

I'd argue that the best way of testing an FTP server is to use an FTP client, not something that can emulate FTP connections (like a browser, etc). Command-line FTP is the simplest, followed by FTP tools - drftp, lftp for command stuff.

I believe there's an FTP client inbuilt into Windows Explorer - Harlequin raised my awareness of that one - but not sure it does SSL connections. I've been told that Gnome's file browser also contains an inbuilt FTP client too.

For windows, I find WinSCP does a pretty good job for FTP/FTPS/SFTP so tend to use it for everything.
User avatar
RageMatrix
Baaaaaaa!
Baaaaaaa!
Posts: 5515
Joined: Fri May 10, 2002 12:52 pm 0
XBL Gamertag: Jon256
Location: East Sussex

Re: The Official *nix Thread

Post by RageMatrix »

Oh, I'd already tested it with various FTP clients - I just also wanted to make it work in a browser as my dad wants to use it and there's no way he'd be able to figure out how even the simplest dedicated FTP client worked :)
XBox Gamertag: Jon256
Wii Code: 4849 1090 9042 6725
"Wrapped in metal, wrapped in ivy"
The Official UNIX/Linux Thread
User avatar
Dungeon-Dave
Baaaaaa!
Baaaaaa!
Posts: 3925
Joined: Thu Aug 04, 2005 12:01 pm 0
Location: UK
Contact:

Re: The Official *nix Thread

Post by Dungeon-Dave »

If your problem is that your pops doesn't know how to operate an FTP client, surely the solution would be to show him and get him to practise a few times to get it right.

I think I had the same convo with Piku: he was looking for technological solutions to what was essentially a knowledge and/or capability problem. I'm not saying that it's the wrong approach, just that many people decide it's easier for them to sand the camel down smaller - yet they don't entertain the notion of ordering a bigger needle. Exploring all different avenues enables you to weigh up the different solutions rather than commit quickly to one which may represent large investment for little returns.
Post Reply