tshark gives "permission denied" writing to (any) file in home dir.
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
tshark gives "permission denied" writing to (any) file in home dir.
greetz~
first, the proper introduction:
Ubuntu Hardy Heron system
with the following tshark install:
Code:
user@host:~/Forensics$ tshark -vv
TShark 1.0.0
...<snip> ...
Compiled with GLib 2.16.1, with libpcap 0.9.8, with libz 1.2.3.3, with POSIX
capabilities (Linux), with libpcre 7.4, without SMI, with ADNS, with Lua 5.1,
with GnuTLS 2.0.4, with Gcrypt 1.2.4, with MIT Kerberos.
Running on Linux 2.6.24-19-generic, with libpcap version 0.9.8.
Built using gcc 4.2.3 (Ubuntu 4.2.3-2ubuntu7).
Running as user "root" and group "root". This could be dangerous.
Capturing on wlan0
tshark: The file to which the capture would be saved ("/home/user/capfile.lpc") could not be opened: Permission denied.
however, if I specify file outside of my homedir, it functions correctly as either root or with 'sudo'
Code:
root@hostname:~# mount
/dev/sda1 on / type ext3 (rw,relatime,errors=remount-ro)
proc on /proc type proc (rw,noexec,nosuid,nodev)
/sys on /sys type sysfs (rw,noexec,nosuid,nodev)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
lrm on /lib/modules/2.6.24-19-generic/volatile type tmpfs (rw)
securityfs on /sys/kernel/security type securityfs (rw)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/user/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=user)
as i get this error writing to any location in the homedir, there is little (read: "no") chance that standard file/dir perms are the issue.
i have gone so far as to 'touch' the destination file first, still receive error.
i'm suspecting 'nosuid' as the culprit but this doesn't really jive with me. before I start tearing things down to t-shoot this i was wondering if anyone had any interesting input here.
thanks in advance;
~k
Last edited by kr0m3; 06-22-2008 at 08:39 PM.
Reason: more info...
Wow, no wonder there haven't been any answers: that's a tough question! As root, you should *NEVER* receive permission errors unless you're doing something that really doesn't make sense, like running "more" on a directory or "ls" on a file.
"nosuid" could be a culprit; another possibility is a bug in that program. Since I've never used it, I can't help you there. If you
find something else about it, make sure to post about it.
I ave the same problem.
The solution seems to be this:
Change the owner of the directory whom you are writing the
output file as the same user running tshark, or dumpcap...
E.g.: if you are root, make sure (che) your working dir
(who tshark are creating the file(s)) is owned by root..
That sounds like a typical problem that can pop up with programs not running as the user whose home directory you are reading/writing in.
IIRC the default permissions for the users home directory are 710 and the user and group name are the same so no one except the user and root are allowed to read/write anything in the users home directory or sub-directories (at least on Fedora).
I had a similar problem using plexmediaserver in that the media files were located in sub-directories under my users home directory and until I modified the home directory permissions to allow access for the plex user the server could not access any files.
Running "ls -l /home" shows the problem here. (My laptop is not modified from the default permissions.)
Quote:
[user@laptop ~]$ ls -l /home
total 36
drwx--x---+ 68 user user 4096 Aug 14 17:55 user
Although I could have added the plex server user to my users group with the same result, I chose to give others execute permissions on my home directory to fix my problem. The same command on my media server machine shows the fix I used.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.