You are not logged in.

#1 2014-10-14 22:39:38

Plox
Member
Registered: 2014-10-14
Posts: 7

Openbox user has no permission to write or read files.

Hello, I installed ArchBang last night and I love it a lot, but I am having issues with the user I made during install. When I was installing it I used the option to create a user that is sudo.  When I start my computer and log into Openbox I log in with the user I made.  When I sudo to do actions like download from pacman, edit files in leafpad or whatnot everything works fine.  When I use my menu to open firefox or google chrome that works also, but when I go to save an image to my computer I cannot since the user has no permission to save files so I have to open chrome or a browser in the terminal under root. When I open gimp it wont load images since the user has no access to do so.  I am not sure how to fix this.  The user I made is 'bang'

this is my Sudoers file

/etc/sudoers

 
## sudoers file.
##
## This file MUST be edited with the 'visudo' command as root.
## Failure to use 'visudo' may result in syntax or file permission errors
## that prevent sudo from running.
##
## See the sudoers man page for the details on how to write a sudoers file.
##

##
## Host alias specification
##
## Groups of machines. These may include host names (optionally with wildcards),
## IP addresses, network numbers or netgroups.
# Host_Alias	WEBSERVERS = www1, www2, www3

##
## User alias specification
##
## Groups of users.  These may consist of user names, uids, Unix groups,
## or netgroups.
# User_Alias	ADMINS = millert, dowdy, mikef

##
## Cmnd alias specification
##
## Groups of commands.  Often used to group related commands together.
# Cmnd_Alias	PROCESSES = /usr/bin/nice, /bin/kill, /usr/bin/renice, \
# 			    /usr/bin/pkill, /usr/bin/top
# Cmnd_Alias	REBOOT = /sbin/halt, /sbin/reboot, /sbin/poweroff

##
## Defaults specification
##
## You may wish to keep some of the following environment variables
## when running commands via sudo.
##
## Locale settings
# Defaults env_keep += "LANG LANGUAGE LINGUAS LC_* _XKB_CHARSET"
##
## Run X applications through sudo; HOME is used to find the
## .Xauthority file.  Note that other programs use HOME to find   
## configuration files and this may lead to privilege escalation!
# Defaults env_keep += "HOME"
##
## X11 resource path settings
# Defaults env_keep += "XAPPLRESDIR XFILESEARCHPATH XUSERFILESEARCHPATH"
##
## Desktop path settings
# Defaults env_keep += "QTDIR KDEDIR"
##
## Allow sudo-run commands to inherit the callers' ConsoleKit session
# Defaults env_keep += "XDG_SESSION_COOKIE"
##
## Uncomment to enable special input methods.  Care should be taken as
## this may allow users to subvert the command being run via sudo.
# Defaults env_keep += "XMODIFIERS GTK_IM_MODULE QT_IM_MODULE QT_IM_SWITCHER"
##
## Uncomment to enable logging of a command's output, except for
## sudoreplay and reboot.  Use sudoreplay to play back logged sessions.
# Defaults log_output
# Defaults!/usr/bin/sudoreplay !log_output
# Defaults!/usr/local/bin/sudoreplay !log_output
# Defaults!REBOOT !log_output

##
## Runas alias specification
##

##
## User privilege specification
##
root ALL=(ALL) ALL
bang ALL=(ALL) ALL

## Uncomment to allow members of group wheel to execute any command
%wheel ALL=(ALL) ALL

## Same thing without a password
%wheel ALL=(ALL)  ALL

## Uncomment to allow members of group sudo to execute any command
%sudo	ALL=(ALL) ALL

## Uncomment to allow any user to run sudo if they know the password
## of the user they are running the command as (root by default).
# Defaults targetpw  # Ask for the password of the target user
# ALL ALL=(ALL) ALL  # WARNING: only use this together with 'Defaults targetpw'

## Read drop-in files from /etc/sudoers.d
## (the '#' here does not indicate a comment)
#includedir /etc/sudoers.d

No sure if I need to share any other config file, but If I need to just let me know.  Thanks.

Offline

#2 2014-10-14 23:01:12

xtremyst
Member
Registered: 2011-11-21
Posts: 331

Re: Openbox user has no permission to write or read files.

Your user has persmission to execute commands with sudo (sudo pacman -S etc), I think you might have a permissions issue with the folder you're trying to save the files to.
Wich folder does your browser use to save hese files?
PS: you can see the permissions for that folder with:

ls -l /path/tofolder

Offline

#3 2014-10-14 23:22:48

Plox
Member
Registered: 2014-10-14
Posts: 7

Re: Openbox user has no permission to write or read files.

You are right, I made the directory 'images' originally under my root user. 

[bang@arch ~]$ ls -la
total 232
drwx------ 32 bang users  4096 Oct 14 09:19 .
drwxr-xr-x  3 root root   4096 Oct 13 05:06 ..
-rw-------  1 bang users    49 Oct 13 05:08 .Xauthority
-rw-r--r--  1 bang users   161 Oct 14  2014 .archey3.cfg
-rw-------  1 bang users  2053 Oct 13 08:55 .bash_history
-rw-r--r--  1 bang users    21 Oct  5 23:06 .bash_logout
-rw-r--r--  1 bang users   305 Sep  7 10:41 .bash_profile
-rw-r--r--  1 bang users   178 Sep  7 10:41 .bashrc
drwxr-xr-x 10 bang users  4096 Oct 14 09:19 .cache
drwxr-xr-x 23 bang users  4096 Oct 15  2014 .config
drwx------  3 bang users  4096 Oct 14  2014 .dbus
-rw-------  1 bang users    16 Oct 15  2014 .esd_auth
-rw-r--r--  1 bang users    49 Oct 15  2014 .fehbg
drwxr-xr-x  4 bang users  4096 Oct 15  2014 .gem
drwxr-xr-x 24 bang users  4096 Oct 14 09:27 .gimp-2.8
-rw-r-----  1 bang users     0 Oct 15  2014 .gksu.lock
drwx------  3 bang users  4096 Oct 13 05:32 .gnome
drwx------  3 bang users  4096 Oct 15  2014 .gnome2
drwx------  2 bang users  4096 Oct 15  2014 .gnome2_private
drwxr-xr-x  2 bang users  4096 Oct 14  2014 .gstreamer-0.10
-rw-r--r--  1 bang users   368 Oct 13 05:06 .gtkrc-2.0
drwxr-xr-x  2 bang users  4096 Sep 21 23:33 .i3
drwxr-xr-x  3 bang users  4096 Sep  7 10:41 .local
drwx------  4 bang users  4096 Oct 15  2014 .mozilla
-rw-r--r--  1 bang users 55963 Oct 14 10:09 .openbox_startup.log
drwx------ 16 bang users  4096 Oct 15  2014 .opera
drwx------  3 bang users  4096 Oct 13 05:32 .pki
drwx------  6 bang users  4096 Oct 15  2014 .purple
drwx------  2 bang users  4096 Oct 15  2014 .ssh
drwx------  5 bang users  4096 Oct 14 09:20 .thumbnails
drwxr-xr-x  2 bang users  4096 Oct 15  2014 .wallpaper
drwxr-xr-x  7 bang users  4096 Oct 15  2014 .wpscan
-rw-r--r--  1 bang users   645 Oct 15  2014 .xinitrc
-rw-r--r--  1 bang users   100 Sep 11 14:42 .xsession
drwxr-xr-x  2 bang users  4096 Oct 15  2014 Desktop
drwxr-xr-x  2 bang users  4096 Oct 13 05:08 Documents
drwxr-xr-x  3 bang users  4096 Oct 13 09:03 Downloads
drwxr-xr-x  2 bang users  4096 Oct 13 05:08 Music
drwxr-xr-x  2 bang users  4096 Oct 13 05:08 Pictures
drwxr-xr-x  2 bang users  4096 Oct 13 05:08 Public
drwxr-xr-x  2 bang users  4096 Oct 13 05:08 Templates
drwxr-xr-x  2 bang users  4096 Oct 13 05:08 Videos
drwxr-xr-x  2 bang users  4096 Sep 29 00:21 bin
drwxr-xr-x  2 root root   4096 Oct 14 10:05 images
drwxr-xr-x  2 bang users  4096 Oct 15  2014 tools


[bang@arch ~]$ cd images/

[bang@arch images]$ ls -al

total 3
drwxr-xr-x  2 root root    4096 Oct 14 10:05 .
drwx------ 32 bang users   4096 Oct 14 09:19 ..
-rw-r-----  1 root root   30941 Oct 14 09:52 2078.jpg
-rw-r-----  1 root root   16821 Oct 14 09:42 40_zps963f40cf.png
-rw-r-----  1 root root  144603 Oct 13 09:05 Black-Birds.jpg

[bang@arch images]$ 

I have removed the directory remade it under my user and tested it, I can save and upload files fine in the browser, also using gimp.  I completely over looked that this is my first time really using linux with a user, and just couldn't figure it out.  Thank you very much for the fast response.

Offline

#4 2014-10-15 04:39:56

dragonauta
Member
Registered: 2012-05-15
Posts: 313
Website

Re: Openbox user has no permission to write or read files.

Hi Plox,next time you have a permission issue: You'd not remove files, just change ownership.

In your case just switch to root user and run this command

# chown bang:users -R /home/bang/images

That would change owner and group (bang:users) for your folder and files inside (-R flag)

This way you preserve your data instead deleting and re-create.


me
"Politicians and diapers need to be changed often ... and for the same reasons."

Offline

Board footer

Powered by FluxBB